Commit graph

1563 commits

Author SHA1 Message Date
Amaan Qureshi
4b6723192e refactor(cli): replace embedded xterm colors file with ansi_colours 2025-01-25 17:20:18 -05:00
Amaan Qureshi
c01bf6ea4a fix(cli): minor discrepancies with pretty printer 2025-01-25 03:47:26 -05:00
ObserverOfTime
5cfeba9c0d feat(bindings): add opt-in zig bindings 2025-01-25 03:47:19 -05:00
Amaan Qureshi
46f8d1267c feat(init): add a title field to grammars 2025-01-25 03:20:43 -05:00
Amaan Qureshi
4820d50336 fix(init): handle parser name replacements better when a kebab-case name is expected 2025-01-25 03:20:43 -05:00
Amaan Qureshi
bde94aed4d feat(init): add a class-name field to grammars 2025-01-25 03:20:43 -05:00
Amaan Qureshi
6dbcfdf282 feat(init): add an optional funding field 2025-01-25 03:20:43 -05:00
Amaan Qureshi
4ab78ae00d fix(init): don't prepend the default filetype with a . 2025-01-25 03:20:43 -05:00
Allan Clements
cda634a1c4 feat: add error information in the progress callback
This allows users to bail parsing if an error was *definitely* detected
using the progress callback, as all possible stack versions have a
non-zero error cost.

Co-authored-by: Amaan Qureshi <amaanq12@gmail.com>
2025-01-25 02:47:39 -05:00
Amaan Qureshi
8bb1448a6f feat: add the semantic version to TSLanguage, and expose an API for retrieving it 2025-01-25 01:14:30 -05:00
Yuri Astrakhan
3e7721e554 chore: a few more minor lints 2025-01-23 00:10:16 -05:00
Amaan Qureshi
3e72969ce4 fix(playground): work around lack of module support in mdbook 2025-01-22 04:09:08 -05:00
Amaan Qureshi
692332ed1c feat!: update playground with new web bindings 2025-01-21 12:36:15 -05:00
Amaan Qureshi
6941497c7a test: improve test coverage 2025-01-21 01:17:03 -05:00
Yuri Astrakhan
9dbe165296 chore: a few minor lints
* do not use `&` for the format args as it cannot (yet) be optimized by the compiler
* a few format inlining
2025-01-21 00:57:58 -05:00
Yuri Astrakhan
48059b72a8 feat: remove lazy_static in favor of LazyLock
This switches to the built-in `std::sync::LazyLock`
2025-01-21 00:21:35 -05:00
Amaan Qureshi
9365586cc3 feat: allow parser balancing to be cancellable 2025-01-20 23:52:19 -05:00
dependabot[bot]
0e226561b1 build(deps): bump emscripten to 4.0.1 2025-01-20 23:27:25 -05:00
Scorg
40eb26e580 build(bindings): move header to tree_sitter subdirectory
This patch allows users to include the parser by the same path from
local build as well as installed location. Previously it was not
possible to include the header prior to installing the built parser.
2025-01-20 13:17:24 -05:00
ObserverOfTime
a9dbb7257c feat(bindings): support free-threaded python build 2025-01-19 12:45:08 -05:00
ObserverOfTime
7bf51ae08a feat(bindings): drop python 3.9 support 2025-01-19 12:45:08 -05:00
WillLillis
3a85d4d5f3 feat(cli): improve readability of parse debug output 2025-01-13 01:13:31 -05:00
WillLillis
23e0891cd5 fix(cli): improve error message for nonterminals used in token rule 2025-01-13 01:12:20 -05:00
Amaan Qureshi
24f51518d1 feat(cli)!: remove migration code for tree-sitter.json 2025-01-12 22:11:30 -05:00
Amaan Qureshi
b26adf4265 feat(generate): add an extra field for extra nodes in node-types.json 2025-01-12 18:41:25 -05:00
Amaan Qureshi
e389d54868 chore: readd skipped test 2025-01-12 13:04:10 -05:00
Amaan Qureshi
5de314833f feat(query): structurally verify supertype queries 2025-01-12 13:04:10 -05:00
Amaan Qureshi
ac8bb1b777 build: bump other crates' MSRV to 1.82 2025-01-12 04:47:59 -05:00
Amaan Qureshi
52ef2992aa feat(generate): properly filter out unused rules 2025-01-12 04:47:59 -05:00
Amaan Qureshi
9d9c76e693 feat(generate): explicitly disallow non-terminals in non-terminals 2025-01-12 04:47:59 -05:00
WillLillis
d65a74a667 fix(cli): correct test update option 2025-01-12 01:44:58 -05:00
WillLillis
ea9c85fb94 fix(cli): fix error display, considering structured data returned from
generate command
2025-01-12 01:44:51 -05:00
WillLillis
dcfc95e563 fix(cli): only remove test input's trailing '\r' if running on windows
platform
2025-01-11 17:52:54 -05:00
WillLillis
f47319212b feat(cli): allow test subcommand to include/exclude by corpus test file names 2025-01-11 00:58:26 -05:00
WillLillis
329dcc92a1 fix(rust): adapt to a few new nightly lints 2025-01-10 22:00:23 -05:00
Amaan Qureshi
d38aa596e1 fix(generate): improve error message when a duplicate token is used as the word token 2025-01-10 02:58:38 -05:00
Amaan Qureshi
4d6740980c fix(generate): improve display of token sets with escape characters 2025-01-10 02:58:38 -05:00
WillLillis
c8bd78a29c feat(playground): provide colored highlight for captures in code editor 2025-01-10 00:45:08 -05:00
Guilherme Soares
207ef9796e
fix(wasm): check docker presence without arguments 2025-01-08 13:27:02 -05:00
WillLillis
cbf960ff20 fix(cli): remove double print of generate errors 2025-01-08 01:13:22 -05:00
Amaan Qureshi
68e707eb4f feat: support passing in a Rust regex in the grammar dsl 2025-01-06 20:52:19 -05:00
Damien Guard
4170f71dbc
feat(generate): add .exp and .lib files to gitignore template
On Windows, tree-sitter-cli creates parser.exp and parser.lib so ideally we'd exclude those automatically.
2025-01-06 16:13:39 -05:00
Amaan Qureshi
ba19fe31be test: ignore flaky test for now
We'll re-enable post-release & when grammars are updated
2025-01-06 01:55:15 -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
Riley Bruins
19482834bd feat: add Supertype API
Introduces a new function that takes in a supertype symbol and returns
all associated subtypes. Can be used by query.c to give better errors
for invalid subtypes, as well as downstream applications like the query
LSP to give better diagnostics.
2025-01-05 00:14:09 -05:00
WillLillis
07c08432ca fix(rust): use PathBuf for --query-paths highlight option 2025-01-04 04:12:24 -05:00
WillLillis
619d347f95 chore: fix doc comment 2025-01-04 04:12:24 -05:00
Amaan Qureshi
efc51a596c fix(lib): don't consider unfinished captures definite when the following step is immediate
When collecting captures, we were treating unfinished ones as definite
even if they had pending immediate steps that weren't yet satisfied. Now
we only mark a capture as definite if the pattern is guaranteed and
there are no pending immediate steps to check.
2025-01-04 02:03:41 -05:00
Amaan Qureshi
5f379da544 fix(lib): prevent wildcards from incorrectly marking child patterns as infallible
When a pattern appears under a wildcard parent (like "(_ (expr))"), we
were incorrectly marking it as infallible. The parent_pattern_guaranteed
flag only means the pattern will match after finding the right wildcard
parent, not that any wildcard parent will work.
2025-01-03 23:09:49 -05:00