Skip to content

How do I debug a grammar? #2218

Closed Answered by sogaiu
verhovsky asked this question in Q&A
Discussion options

You must be logged in to vote

I don't know about figuring out the precise rule, but the --debug and --debug-graph (this one makes a log.html file with svg in it) flags of the parse subcommand for the tree-sitter cli gives some detailed info about parsing.

I have some introductory notes on these bits here and here. Not sure how much help those will be but FWIW.

There's also a --report-states-for-rule option for the generate subcommand, but I'm not sure what it does in detail.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by verhovsky
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants