@willbooster/tree-sitter-c-sharp 14.0.1 → 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 +21 -6
- package/package.json +1 -1
- package/queries/highlights.scm +2 -0
- package/src/node-types.json +4 -0
- 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],
|
|
@@ -718,6 +719,7 @@ module.exports = grammar({
|
|
|
718
719
|
'struct',
|
|
719
720
|
'notnull',
|
|
720
721
|
'unmanaged',
|
|
722
|
+
seq('allows', 'ref', 'struct'),
|
|
721
723
|
$.constructor_constraint,
|
|
722
724
|
field('type', $.type)
|
|
723
725
|
),
|
|
@@ -996,17 +998,29 @@ module.exports = grammar({
|
|
|
996
998
|
_function_body: ($) =>
|
|
997
999
|
choice(field('body', $.block), seq(field('body', $.arrow_expression_clause), statementEnd()), statementEnd()),
|
|
998
1000
|
|
|
999
|
-
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
|
+
),
|
|
1000
1018
|
|
|
1001
1019
|
using_variable_declaration: ($) =>
|
|
1002
1020
|
seq(field('type', $.type), commaSep1(alias($.using_variable_declarator, $.variable_declarator))),
|
|
1003
1021
|
|
|
1004
1022
|
variable_declarator: ($) =>
|
|
1005
|
-
seq(
|
|
1006
|
-
choice(field('name', $.identifier), prec.dynamic(-1, $.tuple_pattern)),
|
|
1007
|
-
optional($.bracketed_argument_list),
|
|
1008
|
-
optional(seq('=', $.expression))
|
|
1009
|
-
),
|
|
1023
|
+
seq(field('name', $.identifier), optional($.bracketed_argument_list), optional(seq('=', $.expression))),
|
|
1010
1024
|
|
|
1011
1025
|
using_variable_declarator: ($) => seq(field('name', $.identifier), optional(seq('=', $.expression))),
|
|
1012
1026
|
|
|
@@ -3428,6 +3442,7 @@ function reservedIdentifiers() {
|
|
|
3428
3442
|
return [
|
|
3429
3443
|
prec(-1, '_'),
|
|
3430
3444
|
'alias',
|
|
3445
|
+
'allows',
|
|
3431
3446
|
'async',
|
|
3432
3447
|
'ascending',
|
|
3433
3448
|
'by',
|
package/package.json
CHANGED
package/queries/highlights.scm
CHANGED
package/src/node-types.json
CHANGED
package/tree-sitter-c_sharp.wasm
CHANGED
|
Binary file
|