dlang-community/SDLang-D

API refactoring suggestions

ZILtoid1991 opened this issue · 1 comments

I think an overhaul on the API would greatly benefit the library, making the addition of many features much easier, taking inspirations from the XML DOM, while also learning from its mistakes.

  • Every SDL element (comments, tags, attributes, and whatever we want to add to a newer spec of the language) should either inherit a base class or an interface, that encapsulates many common things, e.g. formatting info, position in code, etc. If we do it in a clever way, we can make it with minimal compatibility issues.

  • Dynamic parsing. This most likely could be done after building up the DOM tree, which would give it extra features on top of what the XML SAX parser is capable of.

I assume you're referring specifically to the DOM API, and not the pull parser or any other portions, correct? If so, I agree. The whole design of the DOM API is woefully ancient and bitrotted and full of things I would do differently now. It's desperately in need of a redesign.

I'm not sure what you mean by this "dynamic parsing" that's done after a DOM is built...?