@willbooster/tree-sitter-c 3.0.0 → 4.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 -3
- package/package.json +6 -5
- package/tree-sitter-c.wasm +0 -0
- package/tree-sitter.json +1 -1
package/README.md
CHANGED
|
@@ -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 1.
|
|
21
|
+
[@willbooster/web-tree-sitter](https://www.npmjs.com/package/@willbooster/web-tree-sitter) version 1.3.0 or later, which runs in Node.js, Bun, browsers, and Cloudflare Workers. In Node.js and Bun, load the grammar from its path:
|
|
22
22
|
|
|
23
23
|
```js
|
|
24
24
|
import { fileURLToPath } from 'node:url';
|
|
@@ -69,8 +69,8 @@ fuzzed with. Restricted switch-body statement queries require this fork’s gene
|
|
|
69
69
|
|
|
70
70
|
```toml
|
|
71
71
|
[dependencies]
|
|
72
|
-
tree-sitter = { package = "willbooster-tree-sitter", version = "1.
|
|
73
|
-
tree-sitter-c = { package = "willbooster-tree-sitter-c", version = "
|
|
72
|
+
tree-sitter = { package = "willbooster-tree-sitter", version = "1.3.0" }
|
|
73
|
+
tree-sitter-c = { package = "willbooster-tree-sitter-c", version = "4" }
|
|
74
74
|
```
|
|
75
75
|
|
|
76
76
|
```rust
|
|
@@ -96,6 +96,13 @@ 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 ABI 16 generation profile from the applicable `test/corpus` cases and Git-tracked
|
|
100
|
+
files in `examples/`, then generates compact parser tables. The parser also embeds metadata from `tree-sitter.json`. After changing a grammar,
|
|
101
|
+
`tree-sitter.json`, a corpus case, or a tracked example,
|
|
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.
|
|
103
|
+
Profiles in `.tmp/generation-profiles/` are temporary and must not be committed. `bun run build-wasm`, `bun run build/ci`,
|
|
104
|
+
and the release build regenerate the parsers before compiling them.
|
|
105
|
+
|
|
99
106
|
`bun run test` runs:
|
|
100
107
|
|
|
101
108
|
- the corpus in `test/corpus`, with the native build and with the Wasm build (the first run downloads the WASI SDK);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@willbooster/tree-sitter-c",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"description": "C grammar for tree-sitter",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"incremental",
|
|
@@ -26,10 +26,11 @@
|
|
|
26
26
|
"src/scanner.c"
|
|
27
27
|
],
|
|
28
28
|
"scripts": {
|
|
29
|
-
"build-wasm": "script/
|
|
30
|
-
"build/ci": "
|
|
29
|
+
"build-wasm": "script/generate --build-wasm",
|
|
30
|
+
"build/ci": "bun run build-wasm",
|
|
31
31
|
"cleanup": "bun wb lint --fix --format",
|
|
32
32
|
"format": "bun wb lint --format",
|
|
33
|
+
"generate": "script/generate",
|
|
33
34
|
"lint": "bun wb lint",
|
|
34
35
|
"lint-fix": "bun wb lint --fix",
|
|
35
36
|
"prepare": "(bun lefthook install || true) && (test ! -f .lefthook/normalize-bun-lockfile.sh || bash .lefthook/normalize-bun-lockfile.sh)",
|
|
@@ -50,7 +51,7 @@
|
|
|
50
51
|
"@willbooster/oxfmt-config": "1.2.2",
|
|
51
52
|
"@willbooster/oxlint-config": "1.4.8",
|
|
52
53
|
"@willbooster/wb": "22.13.2",
|
|
53
|
-
"@willbooster/web-tree-sitter": "1.
|
|
54
|
+
"@willbooster/web-tree-sitter": "1.4.0",
|
|
54
55
|
"conventional-changelog-conventionalcommits": "10.4.0",
|
|
55
56
|
"lefthook": "2.1.14",
|
|
56
57
|
"oxfmt": "0.70.0",
|
|
@@ -64,7 +65,7 @@
|
|
|
64
65
|
"wrangler": "4.136.1"
|
|
65
66
|
},
|
|
66
67
|
"peerDependencies": {
|
|
67
|
-
"@willbooster/web-tree-sitter": "^1.
|
|
68
|
+
"@willbooster/web-tree-sitter": "^1.3.0"
|
|
68
69
|
},
|
|
69
70
|
"peerDependenciesMeta": {
|
|
70
71
|
"@willbooster/web-tree-sitter": {
|
package/tree-sitter-c.wasm
CHANGED
|
Binary file
|