@willbooster/tree-sitter-c 5.0.5 → 5.1.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/grammar.js CHANGED
@@ -1048,6 +1048,7 @@ module.exports = Object.assign(
1048
1048
  $.cast_expression,
1049
1049
  $.pointer_expression,
1050
1050
  $.sizeof_expression,
1051
+ $.countof_expression,
1051
1052
  $.alignof_expression,
1052
1053
  $.offsetof_expression,
1053
1054
  $.va_arg_expression,
@@ -1146,7 +1147,22 @@ module.exports = Object.assign(
1146
1147
  2,
1147
1148
  prec(
1148
1149
  PREC.SIZEOF,
1149
- seq('sizeof', choice(field('value', $.expression), seq('(', field('type', $.type_descriptor), ')')))
1150
+ seq(
1151
+ 'sizeof',
1152
+ choice(field('value', prec.dynamic(3, $.expression)), seq('(', field('type', $.type_descriptor), ')'))
1153
+ )
1154
+ )
1155
+ ),
1156
+
1157
+ countof_expression: ($) =>
1158
+ prec(
1159
+ PREC.SIZEOF,
1160
+ seq(
1161
+ '_Countof',
1162
+ choice(
1163
+ field('value', prec.dynamic(3, $.expression)),
1164
+ prec.dynamic(2, seq('(', field('type', $.type_descriptor), ')'))
1165
+ )
1150
1166
  )
1151
1167
  ),
1152
1168
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@willbooster/tree-sitter-c",
3
- "version": "5.0.5",
3
+ "version": "5.1.0",
4
4
  "description": "C grammar for tree-sitter",
5
5
  "keywords": [
6
6
  "incremental",
@@ -50,19 +50,19 @@
50
50
  "@vitest/browser-playwright": "5.0.3",
51
51
  "@willbooster/oxfmt-config": "1.2.2",
52
52
  "@willbooster/oxlint-config": "1.4.8",
53
- "@willbooster/wb": "22.24.0",
54
- "@willbooster/web-tree-sitter": "2.0.1",
55
- "conventional-changelog-conventionalcommits": "10.4.0",
56
- "lefthook": "2.1.16",
57
- "oxfmt": "0.71.0",
58
- "oxlint": "1.86.0",
59
- "oxlint-tsgolint": "7.0.2003",
60
- "playwright": "1.63.0",
53
+ "@willbooster/wb": "22.26.1",
54
+ "@willbooster/web-tree-sitter": "2.0.25",
55
+ "conventional-changelog-conventionalcommits": "10.4.1",
56
+ "lefthook": "2.2.1",
57
+ "oxfmt": "0.72.0",
58
+ "oxlint": "1.87.0",
59
+ "oxlint-tsgolint": "7.0.2004",
60
+ "playwright": "1.64.0",
61
61
  "semantic-release": "25.0.9",
62
62
  "sort-package-json": "4.0.0",
63
63
  "typescript": "7.0.2",
64
64
  "vitest": "5.0.3",
65
- "wrangler": "4.147.0"
65
+ "wrangler": "4.149.0"
66
66
  },
67
67
  "peerDependencies": {
68
68
  "@willbooster/web-tree-sitter": "^2.0.0"
@@ -5,6 +5,7 @@
5
5
 
6
6
  ((storage_class_specifier) @keyword
7
7
  (#eq? @keyword "auto"))
8
+ "_Countof" @keyword
8
9
  "_Generic" @keyword
9
10
  "_Thread_local" @keyword
10
11
  "break" @keyword
@@ -159,6 +159,10 @@
159
159
  "type": "conditional_expression",
160
160
  "named": true
161
161
  },
162
+ {
163
+ "type": "countof_expression",
164
+ "named": true
165
+ },
162
166
  {
163
167
  "type": "extension_expression",
164
168
  "named": true
@@ -1288,6 +1292,32 @@
1288
1292
  "named": true,
1289
1293
  "fields": {}
1290
1294
  },
1295
+ {
1296
+ "type": "countof_expression",
1297
+ "named": true,
1298
+ "fields": {
1299
+ "type": {
1300
+ "multiple": false,
1301
+ "required": false,
1302
+ "types": [
1303
+ {
1304
+ "type": "type_descriptor",
1305
+ "named": true
1306
+ }
1307
+ ]
1308
+ },
1309
+ "value": {
1310
+ "multiple": false,
1311
+ "required": false,
1312
+ "types": [
1313
+ {
1314
+ "type": "expression",
1315
+ "named": true
1316
+ }
1317
+ ]
1318
+ }
1319
+ }
1320
+ },
1291
1321
  {
1292
1322
  "type": "declaration",
1293
1323
  "named": true,
@@ -4577,6 +4607,10 @@
4577
4607
  "type": "_Complex",
4578
4608
  "named": false
4579
4609
  },
4610
+ {
4611
+ "type": "_Countof",
4612
+ "named": false
4613
+ },
4580
4614
  {
4581
4615
  "type": "_Generic",
4582
4616
  "named": false
Binary file
package/tree-sitter.json CHANGED
@@ -16,7 +16,7 @@
16
16
  }
17
17
  ],
18
18
  "metadata": {
19
- "version": "5.0.5",
19
+ "version": "5.1.0",
20
20
  "license": "MIT",
21
21
  "description": "C grammar for tree-sitter",
22
22
  "authors": [