@willbooster/tree-sitter-cpp 1.6.0 → 2.0.1

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 CHANGED
@@ -19,7 +19,7 @@ This fork fixes parsing bugs and raises conformance with the ISO C++ standard
19
19
 
20
20
  The npm package ships `tree-sitter-cpp.wasm` for
21
21
  [@willbooster/web-tree-sitter](https://www.npmjs.com/package/@willbooster/web-tree-sitter), which runs in Node.js, Bun,
22
- browsers, and Cloudflare Workers. Install both:
22
+ browsers, and Cloudflare Workers. The compact ABI 16 parser requires runtime 1.3.0 or later. Install both:
23
23
 
24
24
  ```sh
25
25
  npm install @willbooster/tree-sitter-cpp @willbooster/web-tree-sitter
@@ -67,13 +67,12 @@ grammar's in `queries/` and, in `queries/c/`, the highlights of the C grammar it
67
67
 
68
68
  In Rust, depend on the [crate](https://crates.io/crates/willbooster-tree-sitter-cpp) and on
69
69
  [willbooster-tree-sitter](https://crates.io/crates/willbooster-tree-sitter), the runtime this package is tested and
70
- fuzzed with (the grammar also loads in the upstream `tree-sitter` crate 0.27, whose error recovery never ends on some
71
- malformed input):
70
+ fuzzed with. The compact ABI 16 parser requires runtime 1.3.0 or later:
72
71
 
73
72
  ```toml
74
73
  [dependencies]
75
- tree-sitter = { package = "willbooster-tree-sitter", version = "1" }
76
- tree-sitter-cpp = { package = "willbooster-tree-sitter-cpp", version = "1" }
74
+ tree-sitter = { package = "willbooster-tree-sitter", version = "1.3.0" }
75
+ tree-sitter-cpp = { package = "willbooster-tree-sitter-cpp", version = "2" }
77
76
  ```
78
77
 
79
78
  ```rust
@@ -100,6 +99,13 @@ not the ones this package ships with. Its first run downloads that CLI from the
100
99
  with `cargo` (whose build runs the CMake that `mise.toml` pins) when the download fails or the release has no binary
101
100
  that runs here. Run other CLI commands through it as well (e.g. `script/tree-sitter parse file.cpp`).
102
101
 
102
+ `bun run generate` records a fresh ABI 16 generation profile from the applicable `test/corpus` cases and Git-tracked
103
+ files in `examples/`, then generates compact parser tables. The parser also embeds metadata from `tree-sitter.json`. After changing a grammar, the pinned `@willbooster/tree-sitter-c` dependency,
104
+ `tree-sitter.json`, a corpus case, or a tracked example,
105
+ regenerate and commit `src/`. Stage added or removed examples with `git add -A examples` before generation so the profile uses the intended file list.
106
+ Profiles in `.tmp/generation-profiles/` are temporary and must not be committed. `bun run build-wasm`, `bun run build/ci`,
107
+ and the release build regenerate the parsers before compiling them.
108
+
103
109
  `bun run test` runs:
104
110
 
105
111
  - 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-cpp",
3
- "version": "1.6.0",
3
+ "version": "2.0.1",
4
4
  "description": "C++ grammar for tree-sitter",
5
5
  "keywords": [
6
6
  "incremental",
@@ -21,10 +21,11 @@
21
21
  "*.wasm"
22
22
  ],
23
23
  "scripts": {
24
- "build-wasm": "script/tree-sitter build --wasm",
25
- "build/ci": "script/tree-sitter generate && script/tree-sitter build --wasm",
24
+ "build-wasm": "script/generate --build-wasm",
25
+ "build/ci": "bun run build-wasm",
26
26
  "cleanup": "bun wb lint --fix --format",
27
27
  "format": "bun wb lint --format",
28
+ "generate": "script/generate",
28
29
  "lint": "bun wb lint",
29
30
  "lint-fix": "bun wb lint --fix",
30
31
  "prepare": "(bun lefthook install || true) && (test ! -f .lefthook/normalize-bun-lockfile.sh || bash .lefthook/normalize-bun-lockfile.sh)",
@@ -46,7 +47,7 @@
46
47
  "@willbooster/oxlint-config": "1.4.8",
47
48
  "@willbooster/tree-sitter-c": "2.0.0",
48
49
  "@willbooster/wb": "22.13.2",
49
- "@willbooster/web-tree-sitter": "1.1.1",
50
+ "@willbooster/web-tree-sitter": "1.4.0",
50
51
  "conventional-changelog-conventionalcommits": "10.4.0",
51
52
  "lefthook": "2.1.14",
52
53
  "oxfmt": "0.70.0",
@@ -62,7 +63,7 @@
62
63
  "wrangler": "4.136.2"
63
64
  },
64
65
  "peerDependencies": {
65
- "@willbooster/web-tree-sitter": "^1.1.1"
66
+ "@willbooster/web-tree-sitter": "^1.3.0"
66
67
  },
67
68
  "peerDependenciesMeta": {
68
69
  "@willbooster/web-tree-sitter": {
Binary file
package/tree-sitter.json CHANGED
@@ -24,7 +24,7 @@
24
24
  }
25
25
  ],
26
26
  "metadata": {
27
- "version": "1.6.0",
27
+ "version": "2.0.1",
28
28
  "license": "MIT",
29
29
  "description": "C++ grammar for tree-sitter",
30
30
  "authors": [