Commit graph

59 commits

Author SHA1 Message Date
Amaan Qureshi
4940d2c29b fix(cli): correct traversal behavior for finding error nodes 2025-01-26 01:10:01 -05:00
Amaan Qureshi
c01bf6ea4a fix(cli): minor discrepancies with pretty printer 2025-01-25 03:47:26 -05:00
WillLillis
3a85d4d5f3 feat(cli): improve readability of parse debug output 2025-01-13 01:13:31 -05:00
WillLillis
867433afd7 feat(rust): use thiserror for generate crate
Co-authored-by: Amaan Qureshi <amaanq12@gmail.com>
2025-01-05 00:27:12 -05:00
WillLillis
5a825a0930 feat(cli): add json summary of parsing 2025-01-05 00:27:12 -05:00
Amaan Qureshi
6bad1bc6c5 feat(cli): rework parse to use new input handler
Co-authored-by: Will Lillis <will.lillis24@gmail.com>
2025-01-03 16:16:17 -05:00
WillLillis
cd3d967f3c fix(cli): correct range in cst pretty printer 2025-01-01 23:55:16 -05:00
WillLillis
b747261929 feat(cli): display parse and edit times separately for parse --time 2024-12-23 02:06:13 -05:00
Amaan Qureshi
e27160b118 feat(rust): remove usage of deprecated functions 2024-10-31 21:58:35 -04:00
Will Lillis
4705a3153a
feat: Add CST pretty-printer for parser output
Co-authored-by: Amaan Qureshi <amaanq12@gmail.com>
2024-10-12 18:37:12 -04:00
Will Lillis
5c6445edea
chore: misc clippy lints 2024-10-06 17:55:00 -04:00
Amaan Qureshi
8943983df6 feat!: properly handle UTF-16 endianness encoding 2024-10-05 21:12:48 -04:00
Amaan Qureshi
6be6a40bdf fix(cli): do not stop printing dot graphs until edits are re-parsed 2024-10-05 20:08:34 -04:00
Amaan Qureshi
9ef12624c3 feat(cli): add a no-ranges flag to the parse command 2024-09-26 22:43:01 -04:00
Amaan Qureshi
e553578696 feat: add fuzz subcommand 2024-05-30 23:00:45 -04:00
Amaan Qureshi
b35efa8f33 style: format imports 2024-04-11 22:35:43 -04:00
Amaan Qureshi
b40839cd72 style: prefer turbofish syntax where possible 2024-02-19 16:00:50 -05:00
Amaan Qureshi
fd91404ab0 style: tidying 2024-02-19 16:00:50 -05:00
Amaan Qureshi
4149ed4149 chore: provide a CLI flag to open log.html
On macOS, this was done by default regardless of what the user wants.
This was also not done on Windows or Linux. Instead, we now provide a
`--open-log` flag to open the log file in the default browser, and it
works on all platforms.
2024-02-11 02:28:34 -05:00
Amaan Qureshi
dcb34b25ec fix: prettify xml output and add node position info 2024-02-08 18:09:10 -05:00
Daumantas Kavolis
08d211a546
feat: improve time reports 2024-02-07 03:19:02 -05:00
Amaan Qureshi
04ff704bca
chore(cli): apply clippy fixes 2024-02-04 04:18:48 -05:00
Max Brunsfeld
da16cb1459 Introduce language ref-count management C APIs, remove Copy impl for Language in Rust 2023-12-27 14:59:16 -08:00
Max Brunsfeld
3380e0eed7 Fix hang when printing dot graphs from the CLI 2023-10-31 15:59:37 -07:00
Max Brunsfeld
f4e2f68f14 Merge branch 'master' into wasm-language 2023-10-27 12:11:43 +01:00
Andrew Hlynskyi
a5a7564818 chore(rust): add error reporting for position funcs 2023-10-05 17:24:01 +03:00
Andrew Hlynskyi
c63f1680ad chore(rust): improve perf for position funcs 2023-10-05 17:24:01 +03:00
Andrew Hlynskyi
9cc1daafca chore(ffi): remove enum name prefixes from all C enum values 2023-09-03 07:38:27 +03:00
Amaan Qureshi
192793a6ab
fix: avoid panic if input is empty 2023-07-27 03:37:02 -04:00
Amaan Qureshi
9d669abac4 feat: add encoding flag and automatically check if a file might be utf-16 2023-07-10 16:43:35 -04:00
Max Brunsfeld
97fd990822 Add --dot flag to parse subcommand, for printing tree as DOT graph 2023-02-13 12:33:34 -08:00
Max Brunsfeld
d47713ee4a Integrate WASM compilation into the CLI's Loader 2022-11-15 17:14:33 -08:00
Douglas Creager
71c43a869b Allow $ in tree-sitter parse --edit
You can now specify `$` as the position to apply an edit, signifying the
end of the file.  (That prevents you from having to calculate the size
of the file yourself.)
2021-06-23 10:04:29 -04:00
Douglas Creager
d2d01e77e3 cli: Use anyhow and thiserror for errors
This patch updates the CLI to use anyhow and thiserror for error
management.  The main feature that our custom `Error` type was providing
was a _list_ of messages, which would allow us to annotate "lower-level"
errors with more contextual information.  This is exactly what's
provided by anyhow's `Context` trait.

(This is setup work for a future PR that will pull the `config` and
`loader` modules out into separate crates; by using `anyhow` we wouldn't
have to deal with a circular dependency between with the new crates.)
2021-06-09 16:17:23 -04:00
Andrew Hlynskyi
3c0152a331 chore(fmt): Apply 'cargo fmt' to the whole code base 2021-05-19 23:21:43 +03:00
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