@willbooster/tree-sitter-c 13.0.0 → 14.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/grammar.js CHANGED
@@ -707,13 +707,12 @@ module.exports = Object.assign(
707
707
  ),
708
708
 
709
709
  parenthesized_declarator: ($) =>
710
- prec.dynamic(PREC.PAREN_DECLARATOR, seq('(', optional($.ms_call_modifier), $._declarator, ')')),
710
+ prec.dynamic(PREC.PAREN_DECLARATOR, parenthesizedDeclaratorRule($, $._declarator)),
711
711
  parenthesized_field_declarator: ($) =>
712
- prec.dynamic(PREC.PAREN_DECLARATOR, seq('(', optional($.ms_call_modifier), $._field_declarator, ')')),
712
+ prec.dynamic(PREC.PAREN_DECLARATOR, parenthesizedDeclaratorRule($, $._field_declarator)),
713
713
  parenthesized_type_declarator: ($) =>
714
- prec.dynamic(PREC.PAREN_DECLARATOR, seq('(', optional($.ms_call_modifier), $._type_declarator, ')')),
715
- abstract_parenthesized_declarator: ($) =>
716
- prec(1, seq('(', optional($.ms_call_modifier), $._abstract_declarator, ')')),
714
+ prec.dynamic(PREC.PAREN_DECLARATOR, parenthesizedDeclaratorRule($, $._type_declarator)),
715
+ abstract_parenthesized_declarator: ($) => prec(1, parenthesizedDeclaratorRule($, $._abstract_declarator)),
717
716
 
718
717
  attributed_declarator: ($) => seq($._unattributed_declarator, repeat1($.attribute_declaration)),
719
718
  attributed_field_declarator: ($) => seq($._unattributed_field_declarator, repeat1($.attribute_declaration)),
@@ -1766,6 +1765,15 @@ function conditionalMacroRule($, ifdef, ifndef) {
1766
1765
  );
1767
1766
  }
1768
1767
 
1768
+ /**
1769
+ * @param {import('./types/treeSitterDsl').GrammarSymbols<'ms_call_modifier'>} $
1770
+ * @param {import('./types/treeSitterDsl').Rule} declarator
1771
+ */
1772
+ function parenthesizedDeclaratorRule($, declarator) {
1773
+ const parenthesized = seq('(', optional($.ms_call_modifier), declarator, ')');
1774
+ return choice(parenthesized, prec(2, seq($.ms_call_modifier, parenthesized)));
1775
+ }
1776
+
1769
1777
  /**
1770
1778
  * @param {import('./types/treeSitterDsl').GrammarSymbols<'ms_based_modifier' | 'ms_call_modifier' | 'attribute_declaration' | 'ms_pointer_modifier' | 'type_qualifier' | 'attribute_specifier' | 'macro_specifier' | '_conditional_macro_specifier'>} $
1771
1779
  * @param {import('./types/treeSitterDsl').Rule} declarator
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@willbooster/tree-sitter-c",
3
- "version": "13.0.0",
3
+ "version": "14.0.0",
4
4
  "description": "C grammar for tree-sitter",
5
5
  "keywords": [
6
6
  "incremental",
Binary file
package/tree-sitter.json CHANGED
@@ -16,7 +16,7 @@
16
16
  }
17
17
  ],
18
18
  "metadata": {
19
- "version": "13.0.0",
19
+ "version": "14.0.0",
20
20
  "license": "MIT",
21
21
  "description": "C grammar for tree-sitter",
22
22
  "authors": [