Skip to content

Commit bb1a3d2

Browse files
committed
Merge pull request #90 (Expose binding pattern kind)
2 parents 40c945f + 80d6145 commit bb1a3d2

File tree

13 files changed

+500963
-500478
lines changed

13 files changed

+500963
-500478
lines changed

grammar.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,9 +245,11 @@ module.exports = grammar({
245245
")"
246246
),
247247

248+
binding_pattern_kind: $ => choice("val", "var"),
249+
248250
class_parameter: $ => seq(
249251
optional($.modifiers),
250-
optional(choice("val", "var")),
252+
optional($.binding_pattern_kind),
251253
$.simple_identifier,
252254
":",
253255
$._type,
@@ -365,7 +367,7 @@ module.exports = grammar({
365367

366368
property_declaration: $ => prec.right(seq(
367369
optional($.modifiers),
368-
choice("val", "var"),
370+
$.binding_pattern_kind,
369371
optional($.type_parameters),
370372
optional(seq($._receiver_type, optional('.'))),
371373
choice($.variable_declaration, $.multi_variable_declaration),

src/grammar.json

Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -679,6 +679,19 @@
679679
}
680680
]
681681
},
682+
"binding_pattern_kind": {
683+
"type": "CHOICE",
684+
"members": [
685+
{
686+
"type": "STRING",
687+
"value": "val"
688+
},
689+
{
690+
"type": "STRING",
691+
"value": "var"
692+
}
693+
]
694+
},
682695
"class_parameter": {
683696
"type": "SEQ",
684697
"members": [
@@ -698,17 +711,8 @@
698711
"type": "CHOICE",
699712
"members": [
700713
{
701-
"type": "CHOICE",
702-
"members": [
703-
{
704-
"type": "STRING",
705-
"value": "val"
706-
},
707-
{
708-
"type": "STRING",
709-
"value": "var"
710-
}
711-
]
714+
"type": "SYMBOL",
715+
"name": "binding_pattern_kind"
712716
},
713717
{
714718
"type": "BLANK"
@@ -1464,17 +1468,8 @@
14641468
]
14651469
},
14661470
{
1467-
"type": "CHOICE",
1468-
"members": [
1469-
{
1470-
"type": "STRING",
1471-
"value": "val"
1472-
},
1473-
{
1474-
"type": "STRING",
1475-
"value": "var"
1476-
}
1477-
]
1471+
"type": "SYMBOL",
1472+
"name": "binding_pattern_kind"
14781473
},
14791474
{
14801475
"type": "CHOICE",

src/node-types.json

Lines changed: 13 additions & 0 deletions
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
@@ -6416,6 +6425,10 @@
64166425
"type": "bin_literal",
64176426
"named": true
64186427
},
6428+
{
6429+
"type": "binding_pattern_kind",
6430+
"named": true
6431+
},
64196432
{
64206433
"type": "boolean_literal",
64216434
"named": true

0 commit comments

Comments
 (0)