@willbooster/tree-sitter-c-sharp 14.1.0 → 14.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 +19 -6
- package/package.json +1 -1
- package/tree-sitter-c_sharp.wasm +0 -0
- package/tree-sitter.json +1 -1
package/grammar.js
CHANGED
|
@@ -218,6 +218,7 @@ module.exports = grammar({
|
|
|
218
218
|
[$.type_pattern, $.declaration_pattern],
|
|
219
219
|
[$.tuple_element, $.using_variable_declarator],
|
|
220
220
|
[$.tuple_pattern, $.parameter],
|
|
221
|
+
[$.variable_declaration, $.type],
|
|
221
222
|
[$.tuple_pattern, $._simple_name],
|
|
222
223
|
[$.type, $.attribute],
|
|
223
224
|
[$.type, $.nullable_type],
|
|
@@ -997,17 +998,29 @@ module.exports = grammar({
|
|
|
997
998
|
_function_body: ($) =>
|
|
998
999
|
choice(field('body', $.block), seq(field('body', $.arrow_expression_clause), statementEnd()), statementEnd()),
|
|
999
1000
|
|
|
1000
|
-
variable_declaration: ($) =>
|
|
1001
|
+
variable_declaration: ($) =>
|
|
1002
|
+
choice(
|
|
1003
|
+
seq(field('type', $.type), commaSep1($.variable_declarator)),
|
|
1004
|
+
seq(field('type', $.implicit_type), alias($._deconstruction_declarator, $.variable_declarator))
|
|
1005
|
+
),
|
|
1006
|
+
|
|
1007
|
+
_deconstruction_declarator: ($) =>
|
|
1008
|
+
prec.dynamic(1, seq(alias($._deconstruction_tuple_pattern, $.tuple_pattern), '=', $.expression)),
|
|
1009
|
+
|
|
1010
|
+
_deconstruction_tuple_pattern: ($) =>
|
|
1011
|
+
seq(
|
|
1012
|
+
'(',
|
|
1013
|
+
commaSep2(
|
|
1014
|
+
choice(field('name', $.identifier), $.discard, alias($._deconstruction_tuple_pattern, $.tuple_pattern))
|
|
1015
|
+
),
|
|
1016
|
+
')'
|
|
1017
|
+
),
|
|
1001
1018
|
|
|
1002
1019
|
using_variable_declaration: ($) =>
|
|
1003
1020
|
seq(field('type', $.type), commaSep1(alias($.using_variable_declarator, $.variable_declarator))),
|
|
1004
1021
|
|
|
1005
1022
|
variable_declarator: ($) =>
|
|
1006
|
-
seq(
|
|
1007
|
-
choice(field('name', $.identifier), prec.dynamic(-1, $.tuple_pattern)),
|
|
1008
|
-
optional($.bracketed_argument_list),
|
|
1009
|
-
optional(seq('=', $.expression))
|
|
1010
|
-
),
|
|
1023
|
+
seq(field('name', $.identifier), optional($.bracketed_argument_list), optional(seq('=', $.expression))),
|
|
1011
1024
|
|
|
1012
1025
|
using_variable_declarator: ($) => seq(field('name', $.identifier), optional(seq('=', $.expression))),
|
|
1013
1026
|
|
package/package.json
CHANGED
package/tree-sitter-c_sharp.wasm
CHANGED
|
Binary file
|