@willbooster/tree-sitter-cpp 1.2.0 → 1.2.2
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 +15 -8
- package/package.json +5 -6
- package/src/node-types.json +4 -0
- package/tree-sitter-cpp.wasm +0 -0
- package/tree-sitter.json +1 -1
package/README.md
CHANGED
|
@@ -12,7 +12,8 @@ C++ grammar for [tree-sitter](https://github.com/tree-sitter/tree-sitter), forke
|
|
|
12
12
|
[tree-sitter/tree-sitter-cpp](https://github.com/tree-sitter/tree-sitter-cpp). We are grateful
|
|
13
13
|
to its authors and contributors. This is not an official release of that project.
|
|
14
14
|
|
|
15
|
-
This fork fixes parsing bugs and raises conformance with the ISO C++ standard
|
|
15
|
+
This fork fixes parsing bugs and raises conformance with the ISO C++ standard
|
|
16
|
+
([working draft](https://eel.is/c++draft/)).
|
|
16
17
|
|
|
17
18
|
## Usage
|
|
18
19
|
|
|
@@ -97,17 +98,23 @@ cargo test --locked
|
|
|
97
98
|
reparses it, undoes the edits, and reparses again. `TREE_SITTER_SEED`, `TREE_SITTER_ITERATIONS`, and
|
|
98
99
|
`TREE_SITTER_EDITS` run other or more edits;
|
|
99
100
|
- a check that the real-world C++ files in `examples/`, the checked-in ones and those of the cloned repositories,
|
|
100
|
-
fail to parse exactly as listed in `script/known-failures.txt`. The first run clones the repositories. The example
|
|
101
|
-
`script/parse-examples`. After a grammar change or a moved pin alters that
|
|
102
|
-
it; review its diff before committing;
|
|
103
|
-
- a performance check (`test/unit/performance.test.ts`) that recovering from an error on each
|
|
104
|
-
|
|
101
|
+
fail to parse exactly as listed in `script/known-failures.txt`. The first run clones the repositories. The example
|
|
102
|
+
repositories are pinned to commits in `script/parse-examples`. After a grammar change or a moved pin alters that
|
|
103
|
+
list, `script/parse-examples` rewrites it; review its diff before committing;
|
|
104
|
+
- a performance check (`test/unit/performance.test.ts`) that recovering from an error on each line takes linear
|
|
105
|
+
time, since consumers parse files while they are being edited. It loads the Wasm build through
|
|
105
106
|
@willbooster/web-tree-sitter, which `bun run build/ci` rebuilds after regenerating the parser;
|
|
107
|
+
- a check (`test/unit/expressionKeywordParameter.test.ts`) that every keyword that can start an expression but not a
|
|
108
|
+
parameter is expected in the parameters of the function declarators that compete with a direct initialization, so
|
|
109
|
+
that `long(n)(sizeof(b));` stays an initialization;
|
|
110
|
+
- a check (`test/unit/runtimeVersion.test.ts`) that `@willbooster/web-tree-sitter` in `package.json` and
|
|
111
|
+
`willbooster-tree-sitter` in `Cargo.lock` are the same version, since the Wasm tests run on the former and the Rust
|
|
112
|
+
tests and the fuzzer on the latter;
|
|
106
113
|
- checks that the Wasm build parses in Chromium (`test/unit/browser/`) and in Cloudflare Workers with and without
|
|
107
114
|
Node.js compatibility (`test/unit/workers.test.ts`). Run `bun run test/ci-setup` once to install Chromium.
|
|
108
115
|
|
|
109
|
-
CI also runs these tests on Linux arm64 and macOS, where the parser and scanner are compiled natively against each
|
|
110
|
-
(`.github/workflows/robustness.yml`).
|
|
116
|
+
CI also runs these tests on Linux arm64 and macOS, where the parser and scanner are compiled natively against each
|
|
117
|
+
platform's C library, and fuzzes the parser with libFuzzer and sanitizers (`.github/workflows/robustness.yml`).
|
|
111
118
|
|
|
112
119
|
### References
|
|
113
120
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@willbooster/tree-sitter-cpp",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.2",
|
|
4
4
|
"description": "C++ grammar for tree-sitter",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"incremental",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"lint": "bun wb lint",
|
|
28
28
|
"lint-fix": "bun wb lint --fix",
|
|
29
29
|
"prepare": "(bun lefthook install || true) && (test ! -f .lefthook/normalize-bun-lockfile.sh || bash .lefthook/normalize-bun-lockfile.sh)",
|
|
30
|
-
"release": "
|
|
30
|
+
"release": "wb release",
|
|
31
31
|
"prestart": "bun run build-wasm",
|
|
32
32
|
"start": "tree-sitter playground",
|
|
33
33
|
"test": "bun wb test",
|
|
@@ -38,15 +38,14 @@
|
|
|
38
38
|
"verify-full": "bun wb verify --full"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@semantic-release/exec": "7.1.0",
|
|
42
41
|
"@tsconfig/bun": "1.0.11",
|
|
43
42
|
"@types/bun": "1.4.2",
|
|
44
43
|
"@vitest/browser-playwright": "5.0.1",
|
|
45
44
|
"@willbooster/oxfmt-config": "1.2.2",
|
|
46
45
|
"@willbooster/oxlint-config": "1.4.8",
|
|
47
|
-
"@willbooster/tree-sitter-c": "1.1.
|
|
48
|
-
"@willbooster/wb": "22.
|
|
49
|
-
"@willbooster/web-tree-sitter": "1.0.
|
|
46
|
+
"@willbooster/tree-sitter-c": "1.1.4",
|
|
47
|
+
"@willbooster/wb": "22.13.1",
|
|
48
|
+
"@willbooster/web-tree-sitter": "1.0.8",
|
|
50
49
|
"conventional-changelog-conventionalcommits": "10.4.0",
|
|
51
50
|
"lefthook": "2.1.14",
|
|
52
51
|
"oxfmt": "0.70.0",
|
package/src/node-types.json
CHANGED
package/tree-sitter-cpp.wasm
CHANGED
|
Binary file
|