@willbooster/tree-sitter-zig 20.0.0 → 21.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 +11 -9
- package/package.json +6 -7
- package/tree-sitter-zig.wasm +0 -0
- package/tree-sitter.json +1 -1
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
[](https://github.com/WillBooster/tree-sitter-zig/actions/workflows/test.yml)
|
|
6
6
|
[](https://github.com/WillBooster/tree-sitter-zig/actions/workflows/test-rust.yml)
|
|
7
7
|
[](https://github.com/semantic-release/semantic-release)
|
|
8
|
-
[](https://github.com/WillBooster/shared/tree/main/packages/wbfy)
|
|
9
9
|
[](https://crates.io/crates/willbooster-tree-sitter-zig)
|
|
10
10
|
|
|
11
11
|
Zig grammar for [tree-sitter](https://github.com/tree-sitter/tree-sitter), forked from
|
|
@@ -15,7 +15,7 @@ to its authors and contributors. This is not an official release of that project
|
|
|
15
15
|
This fork builds on the grammar of upstream's version 1.1.2 and generates the parser with the
|
|
16
16
|
[WillBooster/tree-sitter](https://github.com/WillBooster/tree-sitter) generator. The parser carries ABI `0x5742000e`,
|
|
17
17
|
which upstream's tree-sitter runtimes reject, and is tested and supported with the WillBooster/tree-sitter runtime,
|
|
18
|
-
version
|
|
18
|
+
version 26.3.0 or later in the 26.x series. It parses as the parser in upstream's 1.1.2 packages does, with these
|
|
19
19
|
exceptions:
|
|
20
20
|
|
|
21
21
|
- A range outside slice brackets or a `for` operand is a syntax error. A sentinel also requires a range,
|
|
@@ -63,15 +63,17 @@ exceptions:
|
|
|
63
63
|
|
|
64
64
|
## Support Scope
|
|
65
65
|
|
|
66
|
-
This fork maintains only full parsing
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
66
|
+
This fork maintains only full parsing, optimized for binary size and parse speed: valid code as found in real-world
|
|
67
|
+
projects yields a correct tree, other valid code yields a correct tree or one with `ERROR` or `MISSING` nodes, and any
|
|
68
|
+
input parses without crashing, hanging, or taking more than linear time. Invalid input may parse without `ERROR` or
|
|
69
|
+
`MISSING` nodes. Incremental parsing is not supported, and no queries (highlights, locals, injections, tags) are
|
|
70
|
+
shipped. Node types, field names, and the trees that error recovery produces may change; such changes are released as
|
|
71
|
+
new major versions.
|
|
70
72
|
|
|
71
73
|
## Usage
|
|
72
74
|
|
|
73
75
|
The npm package ships `tree-sitter-zig.wasm` for
|
|
74
|
-
[@willbooster/web-tree-sitter](https://www.npmjs.com/package/@willbooster/web-tree-sitter) version
|
|
76
|
+
[@willbooster/web-tree-sitter](https://www.npmjs.com/package/@willbooster/web-tree-sitter) version 26.3.0 or later in the 26.x series, which runs in Node.js, Bun, browsers, and Cloudflare Workers.
|
|
75
77
|
In Node.js and Bun, load the grammar from its path:
|
|
76
78
|
|
|
77
79
|
```js
|
|
@@ -119,7 +121,7 @@ In Rust, depend on the [crate](https://crates.io/crates/willbooster-tree-sitter-
|
|
|
119
121
|
fuzzed with:
|
|
120
122
|
|
|
121
123
|
```sh
|
|
122
|
-
cargo add willbooster-tree-sitter@
|
|
124
|
+
cargo add willbooster-tree-sitter@26.3.0 --rename tree-sitter
|
|
123
125
|
cargo add willbooster-tree-sitter-zig --rename tree-sitter-zig
|
|
124
126
|
```
|
|
125
127
|
|
|
@@ -142,7 +144,7 @@ cargo test --locked
|
|
|
142
144
|
|
|
143
145
|
Run tree-sitter CLI commands through `script/tree-sitter`, such as `script/tree-sitter parse file.zig`. It runs the `WillBooster/tree-sitter` CLI at the runtime version locked in `Cargo.lock`. `@willbooster/web-tree-sitter` in `package.json` and `willbooster-tree-sitter` in `Cargo.lock` must stay at the same version (`test/unit/runtimeVersion.test.ts`).
|
|
144
146
|
|
|
145
|
-
After changing `grammar.js
|
|
147
|
+
After changing `grammar.js` or `tree-sitter.json`, run `bun run build/ci` and commit `src/`. Run `script/tree-sitter test` after editing a corpus fixture. When a grammar change or a moved pin in `script/parse-examples` alters which real-world Zig files fail to parse, run `script/parse-examples` to update `script/known-failures.txt` and review its diff before committing.
|
|
146
148
|
|
|
147
149
|
### References
|
|
148
150
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@willbooster/tree-sitter-zig",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "21.0.0",
|
|
4
4
|
"description": "Zig grammar for tree-sitter",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"parsing",
|
|
@@ -50,11 +50,10 @@
|
|
|
50
50
|
"@types/bun": "1.4.5",
|
|
51
51
|
"@vitest/browser-playwright": "5.1.1",
|
|
52
52
|
"@willbooster/oxlint-config": "1.4.9",
|
|
53
|
-
"@willbooster/wb": "24.3.
|
|
54
|
-
"@willbooster/web-tree-sitter": "
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"oxlint": "1.94.0",
|
|
53
|
+
"@willbooster/wb": "24.3.3",
|
|
54
|
+
"@willbooster/web-tree-sitter": "26.3.0",
|
|
55
|
+
"lefthook": "2.2.3",
|
|
56
|
+
"oxlint": "1.95.0",
|
|
58
57
|
"oxlint-tsgolint": "7.0.2008",
|
|
59
58
|
"playwright": "1.65.1",
|
|
60
59
|
"semantic-release": "26.0.1",
|
|
@@ -62,7 +61,7 @@
|
|
|
62
61
|
"wrangler": "4.156.0"
|
|
63
62
|
},
|
|
64
63
|
"peerDependencies": {
|
|
65
|
-
"@willbooster/web-tree-sitter": "^
|
|
64
|
+
"@willbooster/web-tree-sitter": "^26.3.0"
|
|
66
65
|
},
|
|
67
66
|
"peerDependenciesMeta": {
|
|
68
67
|
"@willbooster/web-tree-sitter": {
|
package/tree-sitter-zig.wasm
CHANGED
|
Binary file
|