@willbooster/tree-sitter-cpp 22.0.0 → 24.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
@@ -153,7 +153,8 @@ and the release build regenerate the parsers before compiling them.
153
153
  - a check (`test/unit/grammarPackage.test.ts`) that `tree-sitter.json` is published in the npm package and the crate,
154
154
  that the scanner headers are published in the crate, and that the vendored scanner headers match the installed
155
155
  @willbooster/tree-sitter-c. After updating that dependency, run `script/copy-c-scanner`.
156
- The scanner headers are verbatim copies from that package; their generator paths refer to the C repository.
156
+ Only the headers listed in `script/copy-c-scanner` are verbatim copies from that package; their generator paths
157
+ refer to the C repository. `src/cppTrivia.h` and `src/initializerConditional.h` are maintained here.
157
158
  Review the C scanner dispatch and external-token order against `src/scanner.c` when updating the dependency;
158
159
  - a check (`test/unit/runtimeVersion.test.ts`) that `@willbooster/web-tree-sitter` in `package.json` and
159
160
  `willbooster-tree-sitter` in `Cargo.lock` are the same version, since the Wasm tests run on the former and the Rust
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@willbooster/tree-sitter-cpp",
3
- "version": "22.0.0",
3
+ "version": "24.0.0",
4
4
  "description": "C++ grammar for tree-sitter",
5
5
  "keywords": [
6
6
  "cpp",
@@ -49,7 +49,7 @@
49
49
  "@willbooster/oxlint-config": "1.4.9",
50
50
  "@willbooster/tree-sitter-c": "18.1.0",
51
51
  "@willbooster/wb": "23.0.2",
52
- "@willbooster/web-tree-sitter": "15.0.0",
52
+ "@willbooster/web-tree-sitter": "16.0.0",
53
53
  "conventional-changelog-conventionalcommits": "10.4.1",
54
54
  "lefthook": "2.2.2",
55
55
  "oxlint": "1.89.0",
@@ -61,7 +61,7 @@
61
61
  "wrangler": "4.152.0"
62
62
  },
63
63
  "peerDependencies": {
64
- "@willbooster/web-tree-sitter": "^15.0.0"
64
+ "@willbooster/web-tree-sitter": "^15.0.0 || ^16.0.0"
65
65
  },
66
66
  "peerDependenciesMeta": {
67
67
  "@willbooster/web-tree-sitter": {
@@ -3307,6 +3307,14 @@
3307
3307
  {
3308
3308
  "type": "initializer_list",
3309
3309
  "named": true
3310
+ },
3311
+ {
3312
+ "type": "preproc_if",
3313
+ "named": true
3314
+ },
3315
+ {
3316
+ "type": "preproc_ifdef",
3317
+ "named": true
3310
3318
  }
3311
3319
  ]
3312
3320
  },
@@ -4551,6 +4559,14 @@
4551
4559
  {
4552
4560
  "type": "initializer_list",
4553
4561
  "named": true
4562
+ },
4563
+ {
4564
+ "type": "preproc_if",
4565
+ "named": true
4566
+ },
4567
+ {
4568
+ "type": "preproc_ifdef",
4569
+ "named": true
4554
4570
  }
4555
4571
  ]
4556
4572
  }
@@ -4675,6 +4691,14 @@
4675
4691
  {
4676
4692
  "type": "parameter_pack_expansion",
4677
4693
  "named": true
4694
+ },
4695
+ {
4696
+ "type": "preproc_if",
4697
+ "named": true
4698
+ },
4699
+ {
4700
+ "type": "preproc_ifdef",
4701
+ "named": true
4678
4702
  }
4679
4703
  ]
4680
4704
  }
@@ -6106,6 +6130,10 @@
6106
6130
  "type": "alias_declaration",
6107
6131
  "named": true
6108
6132
  },
6133
+ {
6134
+ "type": "comment",
6135
+ "named": true
6136
+ },
6109
6137
  {
6110
6138
  "type": "concept_definition",
6111
6139
  "named": true
@@ -6202,6 +6230,10 @@
6202
6230
  "type": "parameter_pack_expansion",
6203
6231
  "named": true
6204
6232
  },
6233
+ {
6234
+ "type": "pragma_operator",
6235
+ "named": true
6236
+ },
6205
6237
  {
6206
6238
  "type": "preproc_call",
6207
6239
  "named": true
@@ -6322,6 +6354,10 @@
6322
6354
  "type": "alias_declaration",
6323
6355
  "named": true
6324
6356
  },
6357
+ {
6358
+ "type": "comment",
6359
+ "named": true
6360
+ },
6325
6361
  {
6326
6362
  "type": "concept_definition",
6327
6363
  "named": true
@@ -6418,6 +6454,10 @@
6418
6454
  "type": "parameter_pack_expansion",
6419
6455
  "named": true
6420
6456
  },
6457
+ {
6458
+ "type": "pragma_operator",
6459
+ "named": true
6460
+ },
6421
6461
  {
6422
6462
  "type": "preproc_call",
6423
6463
  "named": true
@@ -6509,6 +6549,10 @@
6509
6549
  "type": "alias_declaration",
6510
6550
  "named": true
6511
6551
  },
6552
+ {
6553
+ "type": "comment",
6554
+ "named": true
6555
+ },
6512
6556
  {
6513
6557
  "type": "concept_definition",
6514
6558
  "named": true
@@ -6605,6 +6649,10 @@
6605
6649
  "type": "parameter_pack_expansion",
6606
6650
  "named": true
6607
6651
  },
6652
+ {
6653
+ "type": "pragma_operator",
6654
+ "named": true
6655
+ },
6608
6656
  {
6609
6657
  "type": "preproc_call",
6610
6658
  "named": true
@@ -6735,7 +6783,7 @@
6735
6783
  "named": true,
6736
6784
  "fields": {
6737
6785
  "alternative": {
6738
- "multiple": false,
6786
+ "multiple": true,
6739
6787
  "required": false,
6740
6788
  "types": [
6741
6789
  {
@@ -6803,6 +6851,10 @@
6803
6851
  "type": "alias_declaration",
6804
6852
  "named": true
6805
6853
  },
6854
+ {
6855
+ "type": "comment",
6856
+ "named": true
6857
+ },
6806
6858
  {
6807
6859
  "type": "concept_definition",
6808
6860
  "named": true
@@ -6899,6 +6951,10 @@
6899
6951
  "type": "parameter_pack_expansion",
6900
6952
  "named": true
6901
6953
  },
6954
+ {
6955
+ "type": "pragma_operator",
6956
+ "named": true
6957
+ },
6902
6958
  {
6903
6959
  "type": "preproc_call",
6904
6960
  "named": true
@@ -6979,7 +7035,7 @@
6979
7035
  "named": true,
6980
7036
  "fields": {
6981
7037
  "alternative": {
6982
- "multiple": false,
7038
+ "multiple": true,
6983
7039
  "required": false,
6984
7040
  "types": [
6985
7041
  {
@@ -7019,6 +7075,10 @@
7019
7075
  "type": "alias_declaration",
7020
7076
  "named": true
7021
7077
  },
7078
+ {
7079
+ "type": "comment",
7080
+ "named": true
7081
+ },
7022
7082
  {
7023
7083
  "type": "concept_definition",
7024
7084
  "named": true
@@ -7115,6 +7175,10 @@
7115
7175
  "type": "parameter_pack_expansion",
7116
7176
  "named": true
7117
7177
  },
7178
+ {
7179
+ "type": "pragma_operator",
7180
+ "named": true
7181
+ },
7118
7182
  {
7119
7183
  "type": "preproc_call",
7120
7184
  "named": true
Binary file
package/tree-sitter.json CHANGED
@@ -20,12 +20,14 @@
20
20
  "src/identifier.h",
21
21
  "src/keywords.h",
22
22
  "src/functionMacro.h",
23
- "src/conditionalMacro.h"
23
+ "src/conditionalMacro.h",
24
+ "src/initializerConditional.h",
25
+ "src/cppTrivia.h"
24
26
  ]
25
27
  }
26
28
  ],
27
29
  "metadata": {
28
- "version": "22.0.0",
30
+ "version": "24.0.0",
29
31
  "license": "MIT",
30
32
  "description": "C++ grammar for tree-sitter",
31
33
  "authors": [