@willbooster/tree-sitter-c 1.0.2 → 1.1.1

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
@@ -859,7 +859,8 @@ module.exports = Object.assign(
859
859
  $.char_literal,
860
860
  $.parenthesized_expression,
861
861
  $.gnu_asm_expression,
862
- $.extension_expression
862
+ $.extension_expression,
863
+ $.builtin_available_expression
863
864
  ),
864
865
 
865
866
  _string: ($) => prec.left(choice($.string_literal, $.concatenated_string)),
@@ -992,6 +993,13 @@ module.exports = Object.assign(
992
993
  call_expression: ($) =>
993
994
  prec(PREC.CALL, seq(field('function', $.expression), field('arguments', $.argument_list))),
994
995
 
996
+ builtin_available_expression: ($) =>
997
+ seq('__builtin_available', '(', commaSep1(choice($.platform_version, '*')), ')'),
998
+
999
+ platform_version: ($) => seq(field('platform', $.identifier), field('version', $.version_number)),
1000
+
1001
+ version_number: () => /\d+(\.\d+){0,2}/,
1002
+
995
1003
  gnu_asm_expression: ($) =>
996
1004
  prec(
997
1005
  PREC.CALL,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@willbooster/tree-sitter-c",
3
- "version": "1.0.2",
3
+ "version": "1.1.1",
4
4
  "description": "C grammar for tree-sitter",
5
5
  "keywords": [
6
6
  "incremental",
@@ -29,7 +29,7 @@
29
29
  "lint": "bun wb lint",
30
30
  "lint-fix": "bun wb lint --fix",
31
31
  "prepare": "(bun lefthook install || true) && (test ! -f .lefthook/normalize-bun-lockfile.sh || bash .lefthook/normalize-bun-lockfile.sh)",
32
- "release": "wb release",
32
+ "release": "node script/release.mjs",
33
33
  "prestart": "bun run build-wasm",
34
34
  "start": "tree-sitter playground",
35
35
  "test": "bun wb test",
@@ -131,6 +131,10 @@
131
131
  "type": "binary_expression",
132
132
  "named": true
133
133
  },
134
+ {
135
+ "type": "builtin_available_expression",
136
+ "named": true
137
+ },
134
138
  {
135
139
  "type": "call_expression",
136
140
  "named": true
@@ -890,6 +894,21 @@
890
894
  "named": true,
891
895
  "fields": {}
892
896
  },
897
+ {
898
+ "type": "builtin_available_expression",
899
+ "named": true,
900
+ "fields": {},
901
+ "children": {
902
+ "multiple": true,
903
+ "required": false,
904
+ "types": [
905
+ {
906
+ "type": "platform_version",
907
+ "named": true
908
+ }
909
+ ]
910
+ }
911
+ },
893
912
  {
894
913
  "type": "call_expression",
895
914
  "named": true,
@@ -2600,6 +2619,32 @@
2600
2619
  ]
2601
2620
  }
2602
2621
  },
2622
+ {
2623
+ "type": "platform_version",
2624
+ "named": true,
2625
+ "fields": {
2626
+ "platform": {
2627
+ "multiple": false,
2628
+ "required": true,
2629
+ "types": [
2630
+ {
2631
+ "type": "identifier",
2632
+ "named": true
2633
+ }
2634
+ ]
2635
+ },
2636
+ "version": {
2637
+ "multiple": false,
2638
+ "required": true,
2639
+ "types": [
2640
+ {
2641
+ "type": "version_number",
2642
+ "named": true
2643
+ }
2644
+ ]
2645
+ }
2646
+ }
2647
+ },
2603
2648
  {
2604
2649
  "type": "pointer_declarator",
2605
2650
  "named": true,
@@ -4276,6 +4321,10 @@
4276
4321
  "type": "__based",
4277
4322
  "named": false
4278
4323
  },
4324
+ {
4325
+ "type": "__builtin_available",
4326
+ "named": false
4327
+ },
4279
4328
  {
4280
4329
  "type": "__cdecl",
4281
4330
  "named": false
@@ -4601,6 +4650,10 @@
4601
4650
  "type": "unsigned",
4602
4651
  "named": false
4603
4652
  },
4653
+ {
4654
+ "type": "version_number",
4655
+ "named": true
4656
+ },
4604
4657
  {
4605
4658
  "type": "volatile",
4606
4659
  "named": false
Binary file
package/tree-sitter.json CHANGED
@@ -16,7 +16,7 @@
16
16
  }
17
17
  ],
18
18
  "metadata": {
19
- "version": "1.0.2",
19
+ "version": "1.1.1",
20
20
  "license": "MIT",
21
21
  "description": "C grammar for tree-sitter",
22
22
  "authors": [