ruby0x1/scribe

Why rewriting the XML parser?

Simn opened this issue · 2 comments

Simn commented

I like the idea of transforming the -xml output to something more readable, but why are you writing an entirely new XML parser for this? Surely it would be easier to use the existing parser (https://github.com/HaxeFoundation/haxe/blob/development/std/haxe/rtti/XmlParser.hx) and then translate the resulting structure (https://github.com/HaxeFoundation/haxe/blob/development/std/haxe/rtti/CType.hx) to whatever you prefer, or print it directly.

I might have a use-case for a JSONified representation, so I am somewhat interested in this library.

  1. I didn't know about that parser
  2. I wrote the original parser in a really short time to implement something specific, and I have just been running with that to finish up some documentation I was working on already.

It does seem like it would be better to use the parser, though.

Simn commented

Ah, I figured you would know about it because you link to its usage in your README (http://old.haxe.org/manual/documentation#writing-a-custom-generator). In that light it seemed really strange to make a new one.

I'm hoping this doesn't invalidate too much of the work you've done so far, but I'm still glad you're aware of it now.