How do I resolve shift/reduce conflict?

they have a tool that generates a c-parser from JS grammar files, like this
This is done for portability since every OS can compile C (but maybe not javascript / node).

when I was working on this PR to tree-sitter-javascript, I only dealt with “the grammar file”
and I could delete all the C code, and when I ran tree-sitter generate, it would all come back.

maybe I’m just getting hung up on something stupid it then. Clearly something is not clicking in to place my brain.

ah ok – that makes me feel a little better. My first pass at this lezer stuff is “just a superset of HTML”

I do know how tree-sitter works. What I’m saying is that most grammars end up defining some externals in their grammar which are implemented by hand, exactly like Lezer’s external tokenizers. Usually (always?) these are in src/scanner.c.

1 Like