Commit graph

94 commits

Author SHA1 Message Date
Amaan Qureshi
021d9c447d test: clean up async boundary test 2025-09-23 01:19:14 -04:00
Amaan Qureshi
ce56465197 test(rust): prefer asserts to panics 2025-09-23 01:19:14 -04:00
Amaan Qureshi
47c9256976 test: clean up parser hang test 2025-09-23 01:19:14 -04:00
WillLillis
92678f0fc5 fix(rust): pass correct fd to C lib's ts_tree_print_dot_graph
Co-authored-by: Amaan Qureshi <git@amaanq.com>
2025-09-21 18:21:57 -04:00
ObserverOfTime
804ef22075 refactor(cli): use the logger
Co-authored-by: Amaan Qureshi <git@amaanq.com>
2025-09-21 01:53:22 -04:00
Amaan Qureshi
fa28b430af feat(bindings): update Zig bindings to use Language.fromRaw 2025-09-21 01:42:26 -04:00
Amaan Qureshi
311585d304 refactor!: rename stage flag to emit 2025-09-20 22:35:23 -04:00
Amaan Qureshi
0ca8fe8c12 feat(playground): add export flag 2025-09-19 17:55:28 -04:00
Amaan Qureshi
0cf217179c feat(rust): add reborrow method to ParseOptions 2025-09-19 17:40:35 -04:00
Amaan Qureshi
a69367f739 feat: add API for editing points and ranges 2025-09-19 17:40:26 -04:00
Amaan Qureshi
074e991280 refactor: deduplicate allocation code in tests 2025-09-18 20:29:54 -04:00
Nia
f09dc3cf46
fix(wasm): fix alias map size computation
This fixes a crash where parsing with certain languages can lead to a crash due to how the alias map was allocated and laid out in wasm memory
2025-09-18 18:34:27 -04:00
ObserverOfTime
f222db57ce fix(bindings): fix ESM errors in Node bindings
1. The module tries to call the native binary as a function.

Only `node-gyp-build` returns a function, so the call is moved there.

2. `node-types.json` is imported with outdated syntax.

Use import attributes which require Node 18.

3. The test does not properly catch import errors.

This is solved by moving the import inside the assertion.
2025-09-18 16:59:34 -04:00
Amaan Qureshi
22553b3372 feat: support compiling to wasm32-unknown-unknown 2025-09-17 04:57:49 -04:00
Will Lillis
46ea65c89b refactor: remove url dependency 2025-09-17 04:31:53 -04:00
Amaan Qureshi
04cfee5664 build(rust): remove unused dependencies 2025-09-16 18:57:06 -04:00
Will Lillis
c54bc441ba fix(test): include failing test's path in error message
This helps when an empty folder was left behind in the corpus directory
2025-09-16 03:51:13 -04:00
Will Lillis
070b91628f fix(rust): appease clippy 2025-09-16 03:51:13 -04:00
Amaan Qureshi
fd68c02072 fix(init): add missing quote in replacement 2025-09-16 02:24:11 -04:00
Amaan Qureshi
39a67eec61 feat: migrate to ESM 2025-09-16 02:24:11 -04:00
Amaan Qureshi
eedbec8f24 feat: remove the need of an external JS runtime for processing grammars 2025-09-16 02:24:11 -04:00
ObserverOfTime
3d26b8e500 feat(bindings): use CapsuleType in Python stub 2025-09-14 19:00:25 -04:00
Amaan Qureshi
d60ef9ad0a feat(rust)!: remove deprecated functions 2025-09-12 02:50:30 -04:00
Amaan Qureshi
917895e6a3 build(nix): build cli with all features 2025-09-11 19:33:52 -04:00
Antonin Delpeuch
6e53dcc8e1
fix(playground): add missing <html> tag 2025-09-11 17:06:34 -04:00
ObserverOfTime
56325d2a3b chore: copy license to all packages 2025-09-11 03:12:35 -04:00
Daniel Müller
937dcf5fd1 feat(rust)!: use ops::ControlFlow as parse and query progress return value
Instead of returning an undocumented boolean flag, use a
core::ops::ControlFlow object. At the expense of being a bit more
verbose, this is a type that should be self-explanatory in the context
of a callback, as an indication of whether to continue processing or
stop.
2025-09-11 01:59:21 -04:00
Amaan Qureshi
3c1f02a7f9 docs(playground): show toast when tree is copied 2025-09-09 03:13:35 -04:00
Amaan Qureshi
907c7bc80b docs(playground): add version information in playground
Co-authored-by: Will Lillis <will.lillis24@gmail.com>
2025-09-09 03:13:35 -04:00
faukah
e4e643086b
refactor: rework nix flake
Co-authored-by: Amaan Qureshi <amaanq12@gmail.com>
2025-09-09 03:03:35 -04:00
Amaan Qureshi
8d6d19de1b build: add package-lock.json for npm cli package 2025-09-09 04:45:57 +02:00
Amaan Qureshi
17854168d9 feat(nix): add cross compilation support 2025-09-04 05:00:14 -04:00
Amaan Qureshi
d287acfcc0 refactor(nix): remove openssl dependency 2025-09-04 05:00:14 -04:00
Amaan Qureshi
1d0ebd1065 fix(rust): do not interpret readme doc comments as doc tests 2025-09-04 04:22:32 -04:00
Will Lillis
cc5463ad44 fix(test): improve readability of corpus error message mismatch 2025-09-04 00:59:44 -04:00
Amaan Qureshi
da61d7cac5 feat: add nix flake 2025-09-01 22:48:37 -04:00
Boris Verkhovskiy
9b23cd5394
feat: use compileStreaming when loading wasm parsers 2025-09-01 22:08:20 -04:00
Will Lillis
a12a79b366 fix(cli): canonicalize --lib-path arguments
This fixes an issue where "./foo.so" would would work but "foo.so" would not.
2025-08-31 01:10:43 -04:00
ObserverOfTime
90bdd63a71 fix(npm): add directory to repository fields
and remove non-existent "main" entry point
2025-08-30 17:16:25 -04:00
ObserverOfTime
ca27fb5d43 fix(cli): fix DSL type declarations 2025-08-30 16:47:47 -04:00
ObserverOfTime
0be215e152 fix(bindings): properly detect MSVC compiler 2025-08-29 13:32:55 +03:00
Amaan Qureshi
8387101a61 fix(lib): allow error nodes to match when they are child nodes 2025-08-28 18:02:47 -04:00
Amaan Qureshi
b7f36a13ba fix(lib): check if an ERROR node is named before assuming it's the builtin error node 2025-08-28 17:13:57 -04:00
ObserverOfTime
107bd800b0 fix(bindings): improve zig dependency fetching logic
Currently, including a tree-sitter parser as a dependency in a zig
project and running `zig build test` on the project will fetch the
zig-tree-sitter dependency declared by the parser. This is a problem
because (a) consumers may not want this dependency for whatever reason
and (b) due to how often Zig breaks everything and how scarcely most
tree-sitter parsers are updated, the zig-tree-sitter version pinned
by the parser module will often be outdated and broken.

The workaround I used was taken from https://ziggit.dev/t/11234
2025-08-28 10:31:24 +03:00
ObserverOfTime
e67f9f8f7a fix(bindings): add tree-sitter as npm dev dependency
npm is supposed to automatically install peer dependencies since v7
but sometimes it's not doing it and we need this dependency for tests
2025-08-27 19:34:09 +03:00
Quentin LE DILAVREC
79177a1cd5
fix(rust): EqCapture accepted cases where number of captured nodes differed by one
Problem: When using alternations, the `#eq?` predicate does not always use the same capture name.

Solution: Iterate the left and right captured nodes more independently.
2025-08-27 10:25:29 +02:00
ObserverOfTime
eb5ad7eb26 feat(playground): add a button to copy the tree
Co-Authored-By: Firas al-Khalil <firasalkhalil@gmail.com>
2025-08-25 10:21:48 +03:00
ObserverOfTime
4602e60c1b refactor(playground): move style to head 2025-08-25 10:21:48 +03:00
ObserverOfTime
1c640ac2c3 fix(cli): correct resource paths 2025-08-25 10:21:48 +03:00
John-Philip Taylor
10f5a42fd7 feat(cli): Version updates (#4179)
- `version` on its own displays the current version
- `version --bump patch` bumps the patch version
- `version --bump minor` bumps the minor version
- `version --bump major` bumps the major version
- `version 1.2.3` bumps the version directly (existing behaviour)

All flavours of version bump displays a string in the form:
`Bumping version 1.2.3 to 4.5.6`
2025-08-24 00:53:41 -04:00