@willbooster/tree-sitter-c 21.0.0 → 22.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 -5
- package/grammar.js +14 -3
- 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
|
@@ -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
|
|
@@ -192,10 +192,9 @@ In Rust, depend on the [crate](https://crates.io/crates/willbooster-tree-sitter-
|
|
|
192
192
|
[willbooster-tree-sitter](https://crates.io/crates/willbooster-tree-sitter), the runtime this package is tested and
|
|
193
193
|
fuzzed with, at version 15.0.3 or later within 15.x. No other runtime loads the parser:
|
|
194
194
|
|
|
195
|
-
```
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
tree-sitter-c = { package = "willbooster-tree-sitter-c", version = "20" }
|
|
195
|
+
```sh
|
|
196
|
+
cargo add willbooster-tree-sitter@15.0.3 --rename tree-sitter
|
|
197
|
+
cargo add willbooster-tree-sitter-c --rename tree-sitter-c
|
|
199
198
|
```
|
|
200
199
|
|
|
201
200
|
```rust
|
package/grammar.js
CHANGED
|
@@ -636,18 +636,20 @@ module.exports = Object.assign(
|
|
|
636
636
|
...preprocIf('_in_statement', () => sym('_block_item')),
|
|
637
637
|
...preprocIf('_in_single_case', () => sym('_single_case_body'), 0, true),
|
|
638
638
|
...preprocIf('_in_field_declaration_list', () => sym('_field_declaration_list_item')),
|
|
639
|
-
...preprocIf('_in_enumerator_list', () =>
|
|
639
|
+
...preprocIf('_in_enumerator_list', () => sym('_enumerator_list_item')),
|
|
640
640
|
...preprocIf(
|
|
641
641
|
'_in_enumerator_list_no_comma',
|
|
642
642
|
() =>
|
|
643
643
|
choice(
|
|
644
|
-
seq(
|
|
645
|
-
sym('
|
|
644
|
+
seq(repeat(sym('_enumerator_list_item')), sym('enumerator'), optional(sym('_enumerator_directives'))),
|
|
645
|
+
repeat1(sym('_enumerator_list_item'))
|
|
646
646
|
),
|
|
647
647
|
0,
|
|
648
648
|
false
|
|
649
649
|
),
|
|
650
650
|
|
|
651
|
+
_enumerator_list_item: ($) => choice(seq($.enumerator, ','), $._enumerator_macro, $._enumerator_directives),
|
|
652
|
+
|
|
651
653
|
_enumerator_directives: ($) => prec.right(repeat1($.preproc_call)),
|
|
652
654
|
|
|
653
655
|
_preproc_newline: () => token.immediate(/\r?\n/),
|
|
@@ -1413,6 +1415,7 @@ module.exports = Object.assign(
|
|
|
1413
1415
|
repeat(
|
|
1414
1416
|
choice(
|
|
1415
1417
|
seq($.enumerator, ','),
|
|
1418
|
+
$._enumerator_macro,
|
|
1416
1419
|
alias(sym('preproc_if_in_enumerator_list'), sym('preproc_if')),
|
|
1417
1420
|
alias(sym('preproc_ifdef_in_enumerator_list'), sym('preproc_ifdef')),
|
|
1418
1421
|
seq($.preproc_call, ','),
|
|
@@ -1485,6 +1488,14 @@ module.exports = Object.assign(
|
|
|
1485
1488
|
|
|
1486
1489
|
bitfield_clause: ($) => seq(':', $.expression),
|
|
1487
1490
|
|
|
1491
|
+
_enumerator_macro: ($) => seq(alias($._enumerator_macro_call, $.call_expression), optional(',')),
|
|
1492
|
+
|
|
1493
|
+
_enumerator_macro_call: ($) =>
|
|
1494
|
+
seq(
|
|
1495
|
+
field('function', $.identifier),
|
|
1496
|
+
field('arguments', alias($._macro_attribute_argument_list, $.argument_list))
|
|
1497
|
+
),
|
|
1498
|
+
|
|
1488
1499
|
enumerator: ($) => seq(field('name', $.identifier), optional(seq('=', field('value', $.expression)))),
|
|
1489
1500
|
|
|
1490
1501
|
variadic_parameter: () => '...',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@willbooster/tree-sitter-c",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "22.0.0",
|
|
4
4
|
"description": "C grammar for tree-sitter",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"c",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"@types/bun": "1.4.4",
|
|
58
58
|
"@vitest/browser-playwright": "5.0.5",
|
|
59
59
|
"@willbooster/oxlint-config": "1.4.9",
|
|
60
|
-
"@willbooster/wb": "
|
|
60
|
+
"@willbooster/wb": "23.0.2",
|
|
61
61
|
"@willbooster/web-tree-sitter": "15.0.3",
|
|
62
62
|
"conventional-changelog-conventionalcommits": "10.4.1",
|
|
63
63
|
"lefthook": "2.2.2",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"playwright": "1.64.1",
|
|
67
67
|
"semantic-release": "25.0.9",
|
|
68
68
|
"vitest": "5.0.5",
|
|
69
|
-
"wrangler": "4.
|
|
69
|
+
"wrangler": "4.152.0"
|
|
70
70
|
},
|
|
71
71
|
"peerDependencies": {
|
|
72
72
|
"@willbooster/web-tree-sitter": "^15.0.3"
|
package/src/node-types.json
CHANGED
package/tree-sitter-c.wasm
CHANGED
|
Binary file
|