@willbooster/tree-sitter-c 1.1.3 → 1.1.5
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 -6
- package/package.json +5 -6
- 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
|
|
@@ -91,20 +91,29 @@ cargo test
|
|
|
91
91
|
`bun run test` runs:
|
|
92
92
|
|
|
93
93
|
- the corpus in `test/corpus`, with the native build and with the Wasm build (the first run downloads the WASI SDK);
|
|
94
|
-
- an incremental-parsing check (`test/unit/incremental.test.ts`): `tree-sitter fuzz
|
|
95
|
-
reparses it, undoes the edits, and reparses again
|
|
96
|
-
`
|
|
94
|
+
- an incremental-parsing check (`test/unit/incremental.test.ts`): `script/fuzz-corpus` runs `tree-sitter fuzz`, which
|
|
95
|
+
edits each corpus case at random, reparses it, undoes the edits, and reparses again, on the CLI of the
|
|
96
|
+
WillBooster/tree-sitter runtime version locked in `Cargo.lock` (`script/fork-cli`; the first run downloads that CLI
|
|
97
|
+
from its GitHub Release, or builds it with `cargo` when the download fails or the release has no binary that runs
|
|
98
|
+
here). `TREE_SITTER_SEED`, `TREE_SITTER_ITERATIONS`, and `TREE_SITTER_EDITS` run other or more edits;
|
|
97
99
|
- a check that the real-world C files in `examples/`, the checked-in ones and those of the cloned repositories, fail to
|
|
98
100
|
parse exactly as listed in `script/known-failures.txt`. Many of the listed files use preprocessor conditionals or
|
|
99
101
|
macros that tree-sitter parses without expanding them. The first run clones the repositories. The example
|
|
100
102
|
repositories are pinned to commits in `script/parse-examples`. After a grammar change or a moved pin alters that
|
|
101
103
|
list, `script/parse-examples` rewrites it; review its diff before committing;
|
|
102
|
-
- a performance check (`test/unit/performance.test.ts`) that recovering from an error on each
|
|
103
|
-
|
|
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
|
|
104
106
|
@willbooster/web-tree-sitter, which `bun run build/ci` rebuilds after regenerating the parser;
|
|
107
|
+
- a check (`test/unit/runtimeVersion.test.ts`) that `@willbooster/web-tree-sitter` in `package.json` and
|
|
108
|
+
`willbooster-tree-sitter` in `Cargo.lock` are the same version, since the Wasm tests run on the former and the Rust
|
|
109
|
+
tests, the fuzzer, and the incremental check on the latter;
|
|
105
110
|
- tests that load the Wasm build with @willbooster/web-tree-sitter in Chromium (`test/e2e/browser.test.ts`) and in
|
|
106
111
|
Cloudflare Workers with and without Node.js compatibility (`test/e2e/workers.test.ts`).
|
|
107
112
|
|
|
113
|
+
The tests and `script/parse-examples` compile the parser into `.tmp/tree-sitter-lib` rather than the CLI's cache shared
|
|
114
|
+
by every checkout; `script/fuzz-corpus` builds a parser of its own in `.tmp/fuzz` for each run and deletes it
|
|
115
|
+
afterwards.
|
|
116
|
+
|
|
108
117
|
CI also runs these tests on Linux arm64 and macOS, where the Rust binding compiles the parser natively, and fuzzes the
|
|
109
118
|
parser with libFuzzer and sanitizers (`.github/workflows/robustness.yml`).
|
|
110
119
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@willbooster/tree-sitter-c",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.5",
|
|
4
4
|
"description": "C grammar for tree-sitter",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"incremental",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"lint": "bun wb lint",
|
|
30
30
|
"lint-fix": "bun wb lint --fix",
|
|
31
31
|
"prepare": "(bun lefthook install || true) && (test ! -f .lefthook/normalize-bun-lockfile.sh || bash .lefthook/normalize-bun-lockfile.sh)",
|
|
32
|
-
"release": "
|
|
32
|
+
"release": "wb release",
|
|
33
33
|
"prestart": "bun run build-wasm",
|
|
34
34
|
"start": "tree-sitter playground",
|
|
35
35
|
"test": "bun wb test",
|
|
@@ -40,19 +40,18 @@
|
|
|
40
40
|
"verify-full": "bun wb verify --full"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@semantic-release/exec": "7.1.0",
|
|
44
43
|
"@tsconfig/bun": "1.0.11",
|
|
45
44
|
"@types/bun": "1.4.2",
|
|
46
45
|
"@vitest/browser-playwright": "5.0.1",
|
|
47
46
|
"@willbooster/oxfmt-config": "1.2.2",
|
|
48
47
|
"@willbooster/oxlint-config": "1.4.8",
|
|
49
|
-
"@willbooster/wb": "22.
|
|
50
|
-
"@willbooster/web-tree-sitter": "1.0.
|
|
48
|
+
"@willbooster/wb": "22.13.1",
|
|
49
|
+
"@willbooster/web-tree-sitter": "1.0.12",
|
|
51
50
|
"conventional-changelog-conventionalcommits": "10.4.0",
|
|
52
51
|
"lefthook": "2.1.14",
|
|
53
52
|
"oxfmt": "0.70.0",
|
|
54
53
|
"oxlint": "1.85.0",
|
|
55
|
-
"oxlint-tsgolint": "7.0.
|
|
54
|
+
"oxlint-tsgolint": "7.0.2003",
|
|
56
55
|
"playwright": "1.63.0",
|
|
57
56
|
"semantic-release": "25.0.9",
|
|
58
57
|
"sort-package-json": "4.0.0",
|
package/tree-sitter-c.wasm
CHANGED
|
Binary file
|