tree-sitter / tree-sitter-cli

CLI tool for creating and testing tree-sitter parsers
MIT License
45 stars 15 forks source link

Quiet parsing option #14

Closed tclem closed 7 years ago

tclem commented 7 years ago

Removes the print (-p) option from parse and prints the tree by default. Adds a new quiet option (-q) that hides this output if so desired. My thinking is that the default use of the parse command is always printing the tree to stdout. Hiding that output is a special case of just wanting to know if parsing succeeded or failed (potentially useful for automated testing).

As part of this, I also improved on the error output when parsing fails by printing the path parsed and the range of the first error node.