Commit graph

24 commits

Author SHA1 Message Date
Yijun Yu
9e08712773 Add --xml option to save the parsed code into XML, using node.start_byte() and node.end_byte() 2021-01-04 22:07:38 +00:00
Max Brunsfeld
b972a7158d Tweak cancellation logic for CLI commands
In 'parse' and 'highlight' cancel on stdin if stdin is a tty.
2020-10-23 12:15:44 -07:00
Patrick Thomson
33435f43c0 Take Max's suggestions. 2020-09-30 09:28:58 -04:00
Patrick Thomson
16bd061b33 Have the caller track stats here. 2020-09-29 15:43:30 -04:00
Patrick Thomson
939cdf12b9 Add --stats flag for reporting parse information. 2020-09-29 12:34:25 -04:00
Max Brunsfeld
0e5ff14976
Requery the parse table when breaking down the parse stack on invalid lookahead (#636)
* Requery parse table after breaking down parse stack due to invalid lookahead

* Include Ruby parser in randomized test suite

Ruby and PHP are our only two languages that use non-terminal extras.
Adding Ruby uncovered some bugs.

* Print edited source code when running parse --edit w/ debug flag

* Recompute lookahead when breaking down stack on invalid lookahead

* Fix stack summary leak when there are two discontinuities on a stack version
2020-06-04 13:40:04 -07:00
Max Brunsfeld
bd466febb4 highlight: Fix panic when cancelled before parsing a nested document 2019-07-16 14:34:24 -07:00
Max Brunsfeld
d274e81d0d Overhaul CLI error handling to allow multiple levels of context 2019-05-30 16:52:55 -07:00
Max Brunsfeld
23c6d78674 Fix presentation of missing nodes in parse command 2019-05-15 16:25:53 -07:00
Max Brunsfeld
701d63dab7 Add --edit flag to parse command 2019-04-08 09:21:03 -07:00
Max Brunsfeld
5035e194ff Merge branch 'master' into node-fields 2019-03-26 11:58:21 -07:00
Max Brunsfeld
0ccb910922 Use a size_t instead of a uint32_t for cancellation flag 2019-03-21 11:26:05 -07:00
Max Brunsfeld
2fd9ffa8e5 Add --cancel flag to parse command to allow command-line testing 2019-03-21 10:56:32 -07:00
Max Brunsfeld
88e3907cc0 Use QueryPerformanceFrequency as clock on windows 2019-03-14 13:42:31 -07:00
Max Brunsfeld
e30e827c5f CLI: Add timeout flag to parse command 2019-03-14 11:52:50 -07:00
Max Brunsfeld
f52271352b Merge branch 'master' into node-fields 2019-03-05 08:08:05 -08:00
Max Brunsfeld
9185f6c168 Clarify parse command error message when failing to read source file 2019-02-19 10:40:27 -08:00
Max Brunsfeld
18a13b457d Get basic field API working 2019-02-08 15:16:56 -08:00
Max Brunsfeld
af694b4c13 cli: Fix exit code of parse subcommand 2019-02-06 16:17:35 -08:00
Max Brunsfeld
50281637d7 binding: Make parse methods more convenient
* Rename parse_str to parse and make it polymorphic.
* Rename parse_utf8 to parse_with, since it is now the callback-based
  version of parse
* Add a parse_utf16 method analogous to parse
* Rename existing parse_utf16 method to parse_utf16_with

This brings in the changes from tree-sitter/rust-tree-sitter#5
2019-02-05 10:59:33 -08:00
Max Brunsfeld
cbcc61a8cf Get parse command handling multiple files, add --time, --quiet flags 2019-01-17 17:15:10 -08:00
Max Brunsfeld
5c3c1dd0bd Get logging flags working properly with test script 2019-01-15 13:21:48 -08:00
Max Brunsfeld
98807d2053 Add debug and debug-graph flags to parse and test commands 2019-01-08 21:03:51 -08:00
Max Brunsfeld
20fcffb393 Add parse subcommand
Co-Authored-By: Timothy Clem <timothy.clem@gmail.com>
2019-01-07 17:57:36 -08:00