@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 +13 -5
- package/package.json +1 -1
- package/tree-sitter-c.wasm +0 -0
- package/tree-sitter.json +1 -1
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,
|
|
710
|
+
prec.dynamic(PREC.PAREN_DECLARATOR, parenthesizedDeclaratorRule($, $._declarator)),
|
|
711
711
|
parenthesized_field_declarator: ($) =>
|
|
712
|
-
prec.dynamic(PREC.PAREN_DECLARATOR,
|
|
712
|
+
prec.dynamic(PREC.PAREN_DECLARATOR, parenthesizedDeclaratorRule($, $._field_declarator)),
|
|
713
713
|
parenthesized_type_declarator: ($) =>
|
|
714
|
-
prec.dynamic(PREC.PAREN_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
package/tree-sitter-c.wasm
CHANGED
|
Binary file
|