3 ms·
Writing grammars presents an interesting set of challenges, especially dealing with ambiguity and precedence as you mention. I find that the `tree-sitter playg
by siraben 5y ago
Writing grammars presents an interesting set of challenges, especially dealing with ambiguity and precedence as you mention. I find that the `tree-sitter playground` command is convenient for interactively trying out different possibilities. There's also a debug flag "-D" for `tree-sitter parse` which gives detailed information about the shift/reduce points in the parser state and different branches it parsed simultaneously (because it's a GLR parser).
- eyelidlessness 5y agoThanks! I found out about the debug flag yesterday, but I was oh my phone after I called it quits so I haven’t tried it yet. Gonna give it a try today.