@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 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: ($) => seq(field('type', $.type), commaSep1($.variable_declarator)),
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@willbooster/tree-sitter-c-sharp",
3
- "version": "14.0.1",
3
+ "version": "14.1.1",
4
4
  "description": "C# grammar for tree-sitter",
5
5
  "keywords": [
6
6
  "incremental",
@@ -124,6 +124,8 @@
124
124
 
125
125
  ;; Keywords
126
126
 
127
+ (type_parameter_constraint "allows" @keyword)
128
+
127
129
  [
128
130
  (modifier)
129
131
  "this"
@@ -8560,6 +8560,10 @@
8560
8560
  "type": "alias",
8561
8561
  "named": false
8562
8562
  },
8563
+ {
8564
+ "type": "allows",
8565
+ "named": false
8566
+ },
8563
8567
  {
8564
8568
  "type": "and",
8565
8569
  "named": false
Binary file
package/tree-sitter.json CHANGED
@@ -30,7 +30,7 @@
30
30
  }
31
31
  ],
32
32
  "metadata": {
33
- "version": "14.0.1",
33
+ "version": "14.1.1",
34
34
  "license": "MIT",
35
35
  "description": "C# grammar for tree-sitter",
36
36
  "authors": [