@willbooster/tree-sitter-c 6.0.0 → 7.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 +4 -4
- package/grammar.js +8 -2
- package/package.json +3 -3
- package/src/node-types.json +4 -0
- 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
|
|
21
|
+
[@willbooster/web-tree-sitter](https://www.npmjs.com/package/@willbooster/web-tree-sitter) version 7.0.5 or later, which runs in Node.js, Bun, browsers, and Cloudflare Workers. The parser carries the ABI number of the WillBooster/tree-sitter generator (`0x57420006`), 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, at version
|
|
68
|
+
fuzzed with, at version 7.0.5 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 = "7.0.5" }
|
|
73
|
+
tree-sitter-c = { package = "willbooster-tree-sitter-c", version = "7" }
|
|
74
74
|
```
|
|
75
75
|
|
|
76
76
|
```rust
|
package/grammar.js
CHANGED
|
@@ -1336,8 +1336,14 @@ module.exports = Object.assign(
|
|
|
1336
1336
|
|
|
1337
1337
|
extension_expression: ($) => seq('__extension__', $.expression),
|
|
1338
1338
|
|
|
1339
|
-
//
|
|
1340
|
-
|
|
1339
|
+
// Compound statements, designated initializers, and a trailing comma parse macro arguments, e.g.
|
|
1340
|
+
// MYFORLOOP(1, 10, i, { foo(i); bar(i); }) and PARAMS(.foo = foo, .bar = { bar, 1 },)
|
|
1341
|
+
argument_list: ($) =>
|
|
1342
|
+
seq(
|
|
1343
|
+
'(',
|
|
1344
|
+
optional(seq(commaSep1(choice($.expression, $.compound_statement, $.initializer_pair)), optional(','))),
|
|
1345
|
+
')'
|
|
1346
|
+
),
|
|
1341
1347
|
|
|
1342
1348
|
field_expression: ($) =>
|
|
1343
1349
|
seq(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@willbooster/tree-sitter-c",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.0",
|
|
4
4
|
"description": "C grammar for tree-sitter",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"incremental",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"@willbooster/oxfmt-config": "1.2.2",
|
|
52
52
|
"@willbooster/oxlint-config": "1.4.8",
|
|
53
53
|
"@willbooster/wb": "22.26.1",
|
|
54
|
-
"@willbooster/web-tree-sitter": "
|
|
54
|
+
"@willbooster/web-tree-sitter": "7.0.5",
|
|
55
55
|
"conventional-changelog-conventionalcommits": "10.4.1",
|
|
56
56
|
"lefthook": "2.2.1",
|
|
57
57
|
"oxfmt": "0.72.0",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"wrangler": "4.149.0"
|
|
65
65
|
},
|
|
66
66
|
"peerDependencies": {
|
|
67
|
-
"@willbooster/web-tree-sitter": "^
|
|
67
|
+
"@willbooster/web-tree-sitter": "^7.0.5"
|
|
68
68
|
},
|
|
69
69
|
"peerDependenciesMeta": {
|
|
70
70
|
"@willbooster/web-tree-sitter": {
|
package/src/node-types.json
CHANGED
package/tree-sitter-c.wasm
CHANGED
|
Binary file
|