@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 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 4.0.2 or later, which runs in Node.js, Bun, browsers, and Cloudflare Workers. The parser carries the ABI number of the WillBooster/tree-sitter generator (`0x57420003`), so it loads only with that runtime; upstream tree-sitter runtimes reject it. In Node.js and Bun, load the grammar from its path:
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 4.0.2 or later. No other runtime loads the parser:
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 = "4.0.2" }
73
- tree-sitter-c = { package = "willbooster-tree-sitter-c", version = "6" }
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
- // The compound_statement is added to parse macros taking statements as arguments, e.g. MYFORLOOP(1, 10, i, { foo(i); bar(i); })
1340
- argument_list: ($) => seq('(', commaSep(choice($.expression, $.compound_statement)), ')'),
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": "6.0.0",
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": "4.0.2",
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": "^4.0.2"
67
+ "@willbooster/web-tree-sitter": "^7.0.5"
68
68
  },
69
69
  "peerDependenciesMeta": {
70
70
  "@willbooster/web-tree-sitter": {
@@ -527,6 +527,10 @@
527
527
  "type": "expression",
528
528
  "named": true
529
529
  },
530
+ {
531
+ "type": "initializer_pair",
532
+ "named": true
533
+ },
530
534
  {
531
535
  "type": "preproc_defined",
532
536
  "named": true
Binary file
package/tree-sitter.json CHANGED
@@ -16,7 +16,7 @@
16
16
  }
17
17
  ],
18
18
  "metadata": {
19
- "version": "6.0.0",
19
+ "version": "7.0.0",
20
20
  "license": "MIT",
21
21
  "description": "C grammar for tree-sitter",
22
22
  "authors": [