polarmutex / tree-sitter-beancount

a tree-sitter parser for the beancount syntax
MIT License
34 stars 8 forks source link

Rewrite it in c #22

Closed amaanq closed 10 months ago

amaanq commented 1 year ago

I also fixed an infinite loop bug where the scanner struggles to decide between HL_STARS or SECTIONEND when in error recovery mode - because one pops and one pushes right after (when both are valid and it is immediately called again there is sort of a "fight" back and forth between these two)

amaanq commented 1 year ago

I noticed the recent commits and updated accordingly - it's ok to return during an error recovery, but it gets tricky when multiple symbols are valid when they shouldn't be, and data like the vector is changed because of that

polarmutex commented 1 year ago

I rather not rewrite into C, can you change logic in current file? or I can do it

Thanks

amaanq commented 1 year ago

Is there a reason for the aversion to rewriting it in C? It would make the grammar more portable and easier to compile for various systems..though I can port the relevant changes to C++ instead if really desired

polarmutex commented 1 year ago

I just prefer C++ and its hard to see logic changes in the midst of changing to C