Conversation
- splitt xml parser and code generator in 2 files - compleatly rewrite xml parser for better readebility and robustness - add proper error handling for parser errors - fix superseed not generating the note properly - add check if used enums exist - enum entries are now sorted by value instead of depth first include order - unknown tags cause an error
… to be consumed upon parsing, simplify ext tag error
|
Impressive work. But unfortunately, I can't allocate the time to review such a massive change anytime soon, especially since it doesn't address an existing bug or provide a feature currently requested by users. The current code works fine and is easy to maintain for now. Replacing it with a from-scratch rewrite would require extensive testing and a very deep review which I cannot do and handle in the near future. Maybe others will do tho. |
That is totally understandable you already doing a lot helping out the project. There are bugs that this addresses but they are very minor (e.g. the description of superseded is not properly generated in some cases). I personally find the current parser not very maintainable and would like to new things e.g. wip tags, that I would prefer to add to the new parser if it has a chance of getting merged. It is not unfeasible to introduce the new parser gradually, so the review burden becomes less step (even tho the total is probably the same).
If you think you would have the time for it (again I totally understand if you don't), I would get started on that. |
The current xml parser is mostly in a single function with a lot of state, that has become increasingly hard to maintain.
This PR fixes this by rewriting the parser that generates the MavProfiles.
The (old) codegenerator and the new xml parser are in 2 seperate files. The old
parser.rsstill contains the rust code generation but is now namedcodegen.rsand the new parser is inparser.rs(the first commit does not rename the files yet so the diff works better).Features of the new parser
The new parser still generates the same MavProfile as the old one, the only changes to the generated code are the fixed supersed bug and the ordering of enum entries.
Since this is a fairly large change I will add some test but unless I find any bugs this has all the functional changes.
Tests