Skip to content

Commit 80d6145

Browse files
committed
.
1 parent 2878163 commit 80d6145

13 files changed

+484210
-483747
lines changed

grammar.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -252,9 +252,11 @@ module.exports = grammar({
252252
")"
253253
),
254254

255+
binding_pattern_kind: $ => choice("val", "var"),
256+
255257
class_parameter: $ => seq(
256258
optional($.modifiers),
257-
optional(choice("val", "var")),
259+
optional($.binding_pattern_kind),
258260
$.simple_identifier,
259261
":",
260262
$._type,
@@ -372,7 +374,7 @@ module.exports = grammar({
372374

373375
property_declaration: $ => prec.right(seq(
374376
optional($.modifiers),
375-
choice("val", "var"),
377+
$.binding_pattern_kind,
376378
optional($.type_parameters),
377379
optional(seq($._receiver_type, optional('.'))),
378380
choice($.variable_declaration, $.multi_variable_declaration),

src/grammar.json

+17-22
Original file line numberDiff line numberDiff line change
@@ -663,6 +663,19 @@
663663
}
664664
]
665665
},
666+
"binding_pattern_kind": {
667+
"type": "CHOICE",
668+
"members": [
669+
{
670+
"type": "STRING",
671+
"value": "val"
672+
},
673+
{
674+
"type": "STRING",
675+
"value": "var"
676+
}
677+
]
678+
},
666679
"class_parameter": {
667680
"type": "SEQ",
668681
"members": [
@@ -682,17 +695,8 @@
682695
"type": "CHOICE",
683696
"members": [
684697
{
685-
"type": "CHOICE",
686-
"members": [
687-
{
688-
"type": "STRING",
689-
"value": "val"
690-
},
691-
{
692-
"type": "STRING",
693-
"value": "var"
694-
}
695-
]
698+
"type": "SYMBOL",
699+
"name": "binding_pattern_kind"
696700
},
697701
{
698702
"type": "BLANK"
@@ -1448,17 +1452,8 @@
14481452
]
14491453
},
14501454
{
1451-
"type": "CHOICE",
1452-
"members": [
1453-
{
1454-
"type": "STRING",
1455-
"value": "val"
1456-
},
1457-
{
1458-
"type": "STRING",
1459-
"value": "var"
1460-
}
1461-
]
1455+
"type": "SYMBOL",
1456+
"name": "binding_pattern_kind"
14621457
},
14631458
{
14641459
"type": "CHOICE",

src/node-types.json

+13
Original file line numberDiff line numberDiff line change
@@ -640,6 +640,11 @@
640640
]
641641
}
642642
},
643+
{
644+
"type": "binding_pattern_kind",
645+
"named": true,
646+
"fields": {}
647+
},
643648
{
644649
"type": "boolean_literal",
645650
"named": true,
@@ -1239,6 +1244,10 @@
12391244
"type": "bin_literal",
12401245
"named": true
12411246
},
1247+
{
1248+
"type": "binding_pattern_kind",
1249+
"named": true
1250+
},
12421251
{
12431252
"type": "boolean_literal",
12441253
"named": true
@@ -6403,6 +6412,10 @@
64036412
"type": "bin_literal",
64046413
"named": true
64056414
},
6415+
{
6416+
"type": "binding_pattern_kind",
6417+
"named": true
6418+
},
64066419
{
64076420
"type": "boolean_literal",
64086421
"named": true

0 commit comments

Comments
 (0)