tree-sitter-cli icon indicating copy to clipboard operation
tree-sitter-cli copied to clipboard

Print a list of tokens for debug purposes

Open jonhue opened this issue 7 years ago • 1 comments

Is there a command (much like parse) that prints a list of tokens?

I am asking because I am trying to debug an error that I am not sure of whether it is rooted in the parser or in the scanner.

jonhue avatar Jan 19 '19 09:01 jonhue

You can use ‘tree-sitter parse my-file -d’ to print out some debugging information. Also, if you have graphviz installed, you can use the ‘-D’ flag to generate a graph that shows the progression of the parse stack.

maxbrunsfeld avatar Jan 19 '19 17:01 maxbrunsfeld