@willbooster/tree-sitter-c 4.0.6 → 5.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 +6 -6
- package/package.json +4 -4
- package/tree-sitter-c.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-c/actions/workflows/test.yml)
|
|
6
6
|
[](https://github.com/WillBooster/tree-sitter-c/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-c)
|
|
10
10
|
|
|
11
11
|
C grammar for [tree-sitter](https://github.com/tree-sitter/tree-sitter), forked from
|
|
@@ -18,7 +18,7 @@ This fork fixes parsing bugs and raises conformance with the ISO C standard
|
|
|
18
18
|
## Usage
|
|
19
19
|
|
|
20
20
|
The npm package ships `tree-sitter-c.wasm` for
|
|
21
|
-
[@willbooster/web-tree-sitter](https://www.npmjs.com/package/@willbooster/web-tree-sitter) version
|
|
21
|
+
[@willbooster/web-tree-sitter](https://www.npmjs.com/package/@willbooster/web-tree-sitter) version 2.0.0 or later, which runs in Node.js, Bun, browsers, and Cloudflare Workers. The parser carries the ABI number of the WillBooster/tree-sitter generator (`0x57420001`), so it loads only with that runtime; upstream tree-sitter runtimes reject it. In Node.js and Bun, load the grammar from its path:
|
|
22
22
|
|
|
23
23
|
```js
|
|
24
24
|
import { fileURLToPath } from 'node:url';
|
|
@@ -65,12 +65,12 @@ adjacency, so the parameter scanner must skip them again to reach `(`.
|
|
|
65
65
|
|
|
66
66
|
In Rust, depend on the [crate](https://crates.io/crates/willbooster-tree-sitter-c) and on
|
|
67
67
|
[willbooster-tree-sitter](https://crates.io/crates/willbooster-tree-sitter), the runtime this package is tested and
|
|
68
|
-
fuzzed with
|
|
68
|
+
fuzzed with, at version 2.0.0 or later. No other runtime loads the parser:
|
|
69
69
|
|
|
70
70
|
```toml
|
|
71
71
|
[dependencies]
|
|
72
|
-
tree-sitter = { package = "willbooster-tree-sitter", version = "
|
|
73
|
-
tree-sitter-c = { package = "willbooster-tree-sitter-c", version = "
|
|
72
|
+
tree-sitter = { package = "willbooster-tree-sitter", version = "2" }
|
|
73
|
+
tree-sitter-c = { package = "willbooster-tree-sitter-c", version = "5" }
|
|
74
74
|
```
|
|
75
75
|
|
|
76
76
|
```rust
|
|
@@ -96,7 +96,7 @@ not the ones this package ships with. Its first run downloads that CLI from the
|
|
|
96
96
|
with `cargo` (whose build runs the CMake that `mise.toml` pins) when the download fails or the release has no binary that runs here. Run other CLI commands through it as
|
|
97
97
|
well (e.g. `script/tree-sitter parse file.c`).
|
|
98
98
|
|
|
99
|
-
`bun run generate` records a fresh
|
|
99
|
+
`bun run generate` records a fresh generation profile from the applicable `test/corpus` cases and Git-tracked
|
|
100
100
|
files in `examples/`, then generates compact parser tables. The parser also embeds metadata from `tree-sitter.json`. After changing a grammar,
|
|
101
101
|
`tree-sitter.json`, a corpus case, or a tracked example,
|
|
102
102
|
regenerate and commit `src/`. Stage added or removed examples with `git add -A examples` before generation so the profile uses the intended file list.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@willbooster/tree-sitter-c",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0",
|
|
4
4
|
"description": "C grammar for tree-sitter",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"incremental",
|
|
@@ -50,8 +50,8 @@
|
|
|
50
50
|
"@vitest/browser-playwright": "5.0.3",
|
|
51
51
|
"@willbooster/oxfmt-config": "1.2.2",
|
|
52
52
|
"@willbooster/oxlint-config": "1.4.8",
|
|
53
|
-
"@willbooster/wb": "22.
|
|
54
|
-
"@willbooster/web-tree-sitter": "
|
|
53
|
+
"@willbooster/wb": "22.24.0",
|
|
54
|
+
"@willbooster/web-tree-sitter": "2.0.1",
|
|
55
55
|
"conventional-changelog-conventionalcommits": "10.4.0",
|
|
56
56
|
"lefthook": "2.1.16",
|
|
57
57
|
"oxfmt": "0.71.0",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"wrangler": "4.147.0"
|
|
66
66
|
},
|
|
67
67
|
"peerDependencies": {
|
|
68
|
-
"@willbooster/web-tree-sitter": "^
|
|
68
|
+
"@willbooster/web-tree-sitter": "^2.0.0"
|
|
69
69
|
},
|
|
70
70
|
"peerDependenciesMeta": {
|
|
71
71
|
"@willbooster/web-tree-sitter": {
|
package/tree-sitter-c.wasm
CHANGED
|
Binary file
|