@willbooster/tree-sitter-rust 18.0.0 → 20.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -11
- package/package.json +10 -11
- package/tree-sitter-rust.wasm +0 -0
- package/tree-sitter.json +1 -1
package/README.md
CHANGED
|
@@ -17,17 +17,16 @@ This fork fixes parsing bugs and raises conformance with [The Rust Reference](ht
|
|
|
17
17
|
## Support Scope
|
|
18
18
|
|
|
19
19
|
This fork maintains only full parsing: valid input yields a correct tree, and invalid input yields `ERROR` or `MISSING`
|
|
20
|
-
nodes without crashing, hanging, or taking more than linear time. Incremental parsing
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
nodes without crashing, hanging, or taking more than linear time. Incremental parsing is not supported, and no queries
|
|
21
|
+
(highlights, locals, injections, tags) are shipped. Node types, field names, and the trees that error recovery produces
|
|
22
|
+
may change; such changes are released as new major versions.
|
|
23
23
|
|
|
24
24
|
## Usage
|
|
25
25
|
|
|
26
26
|
The npm package ships `tree-sitter-rust.wasm` for
|
|
27
27
|
[@willbooster/web-tree-sitter](https://www.npmjs.com/package/@willbooster/web-tree-sitter), which runs in Node.js, Bun,
|
|
28
|
-
browsers, and Cloudflare Workers. The
|
|
29
|
-
version
|
|
30
|
-
share ABI `0x5742000c` and pass the ABI check, but dereference unused `TSLanguage` tables that `19.1.0` and later omit.
|
|
28
|
+
browsers, and Cloudflare Workers. The package requires `@willbooster/web-tree-sitter` `23.0.0` or later within major
|
|
29
|
+
version 23. Its ABI (`0x5742000d`) rejects upstream Tree-sitter runtimes and WillBooster runtimes prior to `22.0.0`.
|
|
31
30
|
|
|
32
31
|
In Node.js and Bun, load the grammar from its path:
|
|
33
32
|
|
|
@@ -70,19 +69,19 @@ parser.setLanguage(await Language.load(rust));
|
|
|
70
69
|
The package also ships the node types in `src/node-types.json`.
|
|
71
70
|
|
|
72
71
|
In Rust, depend on the [crate](https://crates.io/crates/willbooster-tree-sitter-rust) and on
|
|
73
|
-
[willbooster-tree-sitter](https://crates.io/crates/willbooster-tree-sitter)
|
|
74
|
-
fuzzed with.
|
|
75
|
-
`
|
|
76
|
-
share ABI `0x5742000c` and pass that check, but dereference unused `TSLanguage` tables that `19.1.0` and later omit:
|
|
72
|
+
[willbooster-tree-sitter](https://crates.io/crates/willbooster-tree-sitter) `23.0.0` or later within major version 23,
|
|
73
|
+
the runtime this package is tested and fuzzed with. Upstream's `tree-sitter` crate and `willbooster-tree-sitter` releases
|
|
74
|
+
prior to `22.0.0` reject its ABI (`0x5742000d`):
|
|
77
75
|
|
|
78
76
|
```sh
|
|
79
|
-
cargo add willbooster-tree-sitter@
|
|
77
|
+
cargo add willbooster-tree-sitter@23.0.0 --rename tree-sitter
|
|
80
78
|
cargo add willbooster-tree-sitter-rust --rename tree-sitter-rust
|
|
81
79
|
```
|
|
82
80
|
|
|
83
81
|
```rust
|
|
84
82
|
let mut parser = tree_sitter::Parser::new();
|
|
85
83
|
parser.set_language(&tree_sitter_rust::LANGUAGE.into())?;
|
|
84
|
+
let tree = parser.parse("fn main() {}\n").unwrap();
|
|
86
85
|
```
|
|
87
86
|
|
|
88
87
|
## Conditional chains
|
package/package.json
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@willbooster/tree-sitter-rust",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "20.0.0",
|
|
4
4
|
"description": "Rust grammar for tree-sitter",
|
|
5
5
|
"keywords": [
|
|
6
|
-
"incremental",
|
|
7
6
|
"parsing",
|
|
8
7
|
"rust",
|
|
9
8
|
"tree-sitter"
|
|
@@ -46,22 +45,22 @@
|
|
|
46
45
|
"devDependencies": {
|
|
47
46
|
"@tsconfig/bun": "1.0.11",
|
|
48
47
|
"@types/bun": "1.4.4",
|
|
49
|
-
"@vitest/browser-playwright": "5.0
|
|
48
|
+
"@vitest/browser-playwright": "5.1.0",
|
|
50
49
|
"@willbooster/oxlint-config": "1.4.9",
|
|
51
|
-
"@willbooster/wb": "23.3.
|
|
52
|
-
"@willbooster/web-tree-sitter": "
|
|
50
|
+
"@willbooster/wb": "23.3.4",
|
|
51
|
+
"@willbooster/web-tree-sitter": "23.0.0",
|
|
53
52
|
"conventional-changelog-conventionalcommits": "10.4.1",
|
|
54
53
|
"lefthook": "2.2.2",
|
|
55
|
-
"oxlint": "1.
|
|
56
|
-
"oxlint-tsgolint": "7.0.
|
|
57
|
-
"playwright": "1.
|
|
54
|
+
"oxlint": "1.92.0",
|
|
55
|
+
"oxlint-tsgolint": "7.0.2006",
|
|
56
|
+
"playwright": "1.65.0",
|
|
58
57
|
"semantic-release": "25.0.9",
|
|
59
|
-
"vite": "8.3.
|
|
60
|
-
"vitest": "5.0
|
|
58
|
+
"vite": "8.3.6",
|
|
59
|
+
"vitest": "5.1.0",
|
|
61
60
|
"wrangler": "4.156.0"
|
|
62
61
|
},
|
|
63
62
|
"peerDependencies": {
|
|
64
|
-
"@willbooster/web-tree-sitter": "^
|
|
63
|
+
"@willbooster/web-tree-sitter": "^23.0.0"
|
|
65
64
|
},
|
|
66
65
|
"peerDependenciesMeta": {
|
|
67
66
|
"@willbooster/web-tree-sitter": {
|
package/tree-sitter-rust.wasm
CHANGED
|
Binary file
|