@willbooster/tree-sitter-c 15.0.1 → 15.0.2
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 +27 -1
- package/package.json +1 -1
- package/tree-sitter-c.wasm +0 -0
- package/tree-sitter.json +1 -1
package/grammar.js
CHANGED
|
@@ -150,6 +150,8 @@ module.exports = Object.assign(
|
|
|
150
150
|
[$.parameter_list, $._old_style_parameter_list],
|
|
151
151
|
[$.function_declarator, $._function_declaration_declarator],
|
|
152
152
|
[$.pointer_declarator],
|
|
153
|
+
[$.pointer_declarator, $._initialized_declarator],
|
|
154
|
+
[$._initialized_pointer_declarator],
|
|
153
155
|
[$.pointer_declarator, $.abstract_pointer_declarator],
|
|
154
156
|
[$.pointer_field_declarator],
|
|
155
157
|
[$.pointer_type_declarator],
|
|
@@ -225,6 +227,8 @@ module.exports = Object.assign(
|
|
|
225
227
|
$.type_specifier,
|
|
226
228
|
$._declarator,
|
|
227
229
|
$._old_style_declarator,
|
|
230
|
+
$._initialized_declarator,
|
|
231
|
+
$._initialized_parenthesized_content,
|
|
228
232
|
$._field_declarator,
|
|
229
233
|
$._type_declarator,
|
|
230
234
|
$._abstract_declarator,
|
|
@@ -870,7 +874,29 @@ module.exports = Object.assign(
|
|
|
870
874
|
),
|
|
871
875
|
|
|
872
876
|
init_declarator: ($) =>
|
|
873
|
-
seq(
|
|
877
|
+
seq(
|
|
878
|
+
field('declarator', alias($._initialized_declarator, $._declarator)),
|
|
879
|
+
'=',
|
|
880
|
+
field('value', choice($.initializer_list, $.expression))
|
|
881
|
+
),
|
|
882
|
+
|
|
883
|
+
_initialized_declarator: ($) =>
|
|
884
|
+
choice(
|
|
885
|
+
$._declarator,
|
|
886
|
+
alias($._initialized_parenthesized_declarator, $.parenthesized_declarator),
|
|
887
|
+
alias($._initialized_pointer_declarator, $.pointer_declarator)
|
|
888
|
+
),
|
|
889
|
+
|
|
890
|
+
_initialized_parenthesized_declarator: ($) =>
|
|
891
|
+
parenthesizedDeclaratorRule($, alias($._initialized_parenthesized_content, $._declarator)),
|
|
892
|
+
|
|
893
|
+
_initialized_parenthesized_content: ($) =>
|
|
894
|
+
choice(
|
|
895
|
+
alias($._initialized_pointer_declarator, $.pointer_declarator),
|
|
896
|
+
alias($._initialized_parenthesized_declarator, $.parenthesized_declarator)
|
|
897
|
+
),
|
|
898
|
+
|
|
899
|
+
_initialized_pointer_declarator: ($) => pointerDeclaratorRule($, alias($._initialized_declarator, $._declarator)),
|
|
874
900
|
|
|
875
901
|
compound_statement: ($) => seq('{', repeat($._block_item), '}'),
|
|
876
902
|
|
package/package.json
CHANGED
package/tree-sitter-c.wasm
CHANGED
|
Binary file
|