Commit graph

5950 commits

Author SHA1 Message Date
ObserverOfTime
6dfa79013f feat(loader): respect NM env var 2025-09-20 18:08:07 -04:00
ObserverOfTime
79ef484392 ci: cross-compile without cross-rs 2025-09-20 18:08:07 -04:00
Amaan Qureshi
0ca8fe8c12 feat(playground): add export flag 2025-09-19 17:55:28 -04:00
John-Philip Taylor
552ab537e8
docs(cli): add docs on new version features 2025-09-19 17:52:08 -04:00
Amaan Qureshi
0cf217179c feat(rust): add reborrow method to ParseOptions 2025-09-19 17:40:35 -04:00
Amaan Qureshi
48a5077035 feat(web)!: add API for editing points and ranges 2025-09-19 17:40:26 -04:00
Amaan Qureshi
a69367f739 feat: add API for editing points and ranges 2025-09-19 17:40:26 -04:00
Will Lillis
1a0868c487 build: add static and shared targets to Makefile 2025-09-19 17:06:27 -04:00
Max Brunsfeld
9be3e2bdd8 0.26.0 2025-09-19 08:14:00 -07: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
d29132512b ci: build wasm32 2025-09-17 04:57:49 -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
Will Lillis
6a28a62369 test: add safety checks to ensure langauge version constants are kept in
sync

The generate crate defines the `LANGUAGE_VERSION` constant separately
from the TREE_SITTER_LANGUAGE_VERSION definition in `api.h`.
2025-09-17 02:58:31 -04:00
Amaan Qureshi
db0d05fab3 ci: fix cache paths 2025-09-17 02:19:29 -04:00
Amaan Qureshi
317e2e74c2 Revert "feat(generate): allow more characters for keywords"
This reverts commit 0269357c5a.
2025-09-17 02:19:29 -04:00
Amaan Qureshi
04cfee5664 build(rust): remove unused dependencies 2025-09-16 18:57:06 -04:00
Amaan Qureshi
57c6105897 fix(generate): remove warning message for CJS grammars 2025-09-16 16:42:17 -04:00
Christian Clason
339bad2de4 feat(generate): don't embed tree-sitter CLI version in parser
Problem: embedding the CLI version used to generate a parser triggers CI
failures on all grammars for every (patch) release of tree-sitter, even
if there are no actual parser changes.

Solution: do not embed the version; instead rely on whether the update
introduces actual (presumably desirable) changes in the parser to
indicate regeneration is necessary.
2025-09-16 19:21:34 +02:00
Will Lillis
31ff62445b fix(generate): assert there is a Nfa last state before retrieving it
Prevents unsigned subtraction wrapping antics in release builds
2025-09-16 03:51:13 -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
bbb651
9593737871 build(generate): remove tree-sitter dependency
It was only used to share two constants, and balloons its dependencies.

This also makes `generate_parser_for_grammar` work in wasm.
(Tested in `wasm32-wasip2` in wasmtime with the json grammar,
`wasm32-unknown-unknown` running in the same setup exited successfully
so I'm pretty confident it works as well)

Co-authored-by: Amaan Qureshi <contact@amaanq.com>
2025-09-16 03:48:30 -04:00
Amaan Qureshi
0269357c5a feat(generate): allow more characters for keywords 2025-09-16 03:01:56 -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
67f50b85f5 docs: document the native js runtime 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
dependabot[bot]
7ba7c4a8ce build(deps): bump the cargo group with 7 updates
Bumps the cargo group with 7 updates:

| Package | From | To |
| --- | --- | --- |
| [cc](https://github.com/rust-lang/cc-rs) | `1.2.36` | `1.2.37` |
| [indexmap](https://github.com/indexmap-rs/indexmap) | `2.11.0` | `2.11.1` |
| [semver](https://github.com/dtolnay/semver) | `1.0.26` | `1.0.27` |
| [serde](https://github.com/serde-rs/serde) | `1.0.219` | `1.0.224` |
| [serde_derive](https://github.com/serde-rs/serde) | `1.0.219` | `1.0.224` |
| [serde_json](https://github.com/serde-rs/json) | `1.0.143` | `1.0.145` |
| [tempfile](https://github.com/Stebalien/tempfile) | `3.21.0` | `3.22.0` |


Updates `cc` from 1.2.36 to 1.2.37
- [Release notes](https://github.com/rust-lang/cc-rs/releases)
- [Changelog](https://github.com/rust-lang/cc-rs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/cc-rs/compare/cc-v1.2.36...cc-v1.2.37)

Updates `indexmap` from 2.11.0 to 2.11.1
- [Changelog](https://github.com/indexmap-rs/indexmap/blob/main/RELEASES.md)
- [Commits](https://github.com/indexmap-rs/indexmap/compare/2.11.0...2.11.1)

Updates `semver` from 1.0.26 to 1.0.27
- [Release notes](https://github.com/dtolnay/semver/releases)
- [Commits](https://github.com/dtolnay/semver/compare/1.0.26...1.0.27)

Updates `serde` from 1.0.219 to 1.0.224
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.219...v1.0.224)

Updates `serde_derive` from 1.0.219 to 1.0.224
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.219...v1.0.224)

Updates `serde_json` from 1.0.143 to 1.0.145
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.143...v1.0.145)

Updates `tempfile` from 3.21.0 to 3.22.0
- [Changelog](https://github.com/Stebalien/tempfile/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Stebalien/tempfile/compare/v3.21.0...v3.22.0)

---
updated-dependencies:
- dependency-name: cc
  dependency-version: 1.2.37
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo
- dependency-name: indexmap
  dependency-version: 2.11.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo
- dependency-name: semver
  dependency-version: 1.0.27
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo
- dependency-name: serde
  dependency-version: 1.0.224
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo
- dependency-name: serde_derive
  dependency-version: 1.0.224
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo
- dependency-name: serde_json
  dependency-version: 1.0.145
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo
- dependency-name: tempfile
  dependency-version: 3.22.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: cargo
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-15 19:32:27 -04:00
dependabot[bot]
b6f45b0a2e build(deps): bump the npm group across 1 directory with 4 updates
Bumps the npm group with 4 updates in the /lib/binding_web directory: [@types/emscripten](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/emscripten), [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node), [typescript](https://github.com/microsoft/TypeScript) and [typescript-eslint](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/typescript-eslint).


Updates `@types/emscripten` from 1.41.1 to 1.41.2
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/emscripten)

Updates `@types/node` from 24.3.1 to 24.5.0
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Updates `typescript` from 5.8.3 to 5.9.2
- [Release notes](https://github.com/microsoft/TypeScript/releases)
- [Changelog](https://github.com/microsoft/TypeScript/blob/main/azure-pipelines.release-publish.yml)
- [Commits](https://github.com/microsoft/TypeScript/compare/v5.8.3...v5.9.2)

Updates `typescript-eslint` from 8.43.0 to 8.44.0
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/typescript-eslint/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.44.0/packages/typescript-eslint)

---
updated-dependencies:
- dependency-name: "@types/emscripten"
  dependency-version: 1.41.2
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm
- dependency-name: "@types/node"
  dependency-version: 24.5.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm
- dependency-name: typescript
  dependency-version: 5.9.2
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm
- dependency-name: typescript-eslint
  dependency-version: 8.44.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-15 19:32:20 -04:00
ObserverOfTime
3d26b8e500 feat(bindings): use CapsuleType in Python stub 2025-09-14 19:00:25 -04:00
Amaan Qureshi
46f7f860e6 docs: correct explanation about @ignore capture 2025-09-14 16:45:39 -04:00
Amaan Qureshi
2ae677162f docs: clarify that only the whitespace character class is simplfied 2025-09-14 16:45:39 -04:00
Amaan Qureshi
4dbfb5b49a docs: document the @ignore capture in tags 2025-09-14 06:27:27 -04:00
Amaan Qureshi
3a911d578c docs: add more information on supertype nodes for grammars and queries 2025-09-14 06:25:35 -04:00
Amaan Qureshi
63f48afaeb docs: explain extras in a bit more detail 2025-09-14 06:02:00 -04:00
Will Lillis
ac39aed7c5 fix(lib/wasm): return NULL for 0-sized allocations
Co-authored-by: Amaan Qureshi <contact@amaanq.com>
2025-09-13 22:29:47 -04:00
Amaan Qureshi
c4d02a5254 build(lib): regenerate wasm stdlib
Co-authored-by: Will Lillis <will.lillis24@gmail.com>
2025-09-13 22:29:47 -04:00
Amaan Qureshi
69c42450c3 fix(lib/wasm): keep track of freed blocks that are not the last allocated pointer
This fixes issues where the scanner allocates and frees a lot of data
during a single parse.

Co-authored-by: Will Lillis <will.lillis24@gmail.com>
2025-09-13 22:29:47 -04:00
Amaan Qureshi
b863b16454 fix(xtask): make building the wasm stdlib work again
Co-authored-by: Will Lillis <will.lillis24@gmail.com>
2025-09-13 22:29:47 -04:00
Will Lillis
0c35511aea fix(lib): improve wasm scanner serialization error handling
Co-authored-by: Amaan Qureshi <contact@amaanq.com>
2025-09-13 22:29:47 -04:00
Amaan Qureshi
06741d0d5d fix(playground): check that languageVersion exists for compat 2025-09-13 22:12:11 -04:00
RedCMD
ca8b944b53
build(web): fix cjs build 2025-09-13 05:51:42 -04:00
Amaan Qureshi
580cd9541a feat(web)!: remove deprecated functions 2025-09-12 02:50:30 -04:00
Amaan Qureshi
d60ef9ad0a feat(rust)!: remove deprecated functions 2025-09-12 02:50:30 -04:00
Amaan Qureshi
821cf797f2 feat(lib)!: 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