dbaumgarten / yodk

Development Kit for Starbase's ingame programming language YOLOL
MIT License
57 stars 16 forks source link

Parser permit nolol inline comments (untested) #122

Open Woccz opened 2 years ago

Woccz commented 2 years ago

What this PR does / why we need it**:

Should allow for inlining of comments in nolol (untested).

Which issue(s) this PR fixes**:

Fixes #53

Checklist:

dbaumgarten commented 2 years ago

Unforunately, what you are trying to do here isn't that easy. If you just skip the comments during parsing, like you are doing currently, the comments will be lost when auto-formatting code. And that would be a bad thing.

All the comments must be saved during parsing, so that they can be re-inserted when printing the ast. That makes all this much mor cumbersome, which is why I haven't bothered to implement comments at every single possible location.