@hew-lang/tree-sitter-hew 1.4.2 → 1.4.4
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 +4 -3
- package/package.json +1 -1
- package/src/grammar.json +38 -4
- package/src/parser.c +75310 -75244
- package/tree-sitter.json +1 -1
package/grammar.js
CHANGED
|
@@ -965,13 +965,14 @@ export default grammar({
|
|
|
965
965
|
|
|
966
966
|
match_arm: $ => prec(3, seq(
|
|
967
967
|
$._match_arm_head,
|
|
968
|
-
field('value', choice($._block_arm_value, seq($.expression, ','))),
|
|
968
|
+
field('value', choice(seq($._block_arm_value, optional(',')), seq($.expression, ','))),
|
|
969
969
|
)),
|
|
970
970
|
|
|
971
971
|
_match_final_arm: $ => prec(3, seq($._match_arm_head, field('value', $.expression))),
|
|
972
972
|
|
|
973
973
|
// Match and select share the compiler's source-token classification:
|
|
974
|
-
// brace-bodied
|
|
974
|
+
// brace-bodied arms may add one comma, while expression arms need it
|
|
975
|
+
// before the next arm.
|
|
975
976
|
_block_arm_value: $ => choice(
|
|
976
977
|
$.block,
|
|
977
978
|
$.if_expression,
|
|
@@ -1479,7 +1480,7 @@ export default grammar({
|
|
|
1479
1480
|
// stays usable as an ordinary name everywhere else.
|
|
1480
1481
|
select_arm: $ => prec(3, seq(
|
|
1481
1482
|
$._select_arm_head,
|
|
1482
|
-
field('body', choice($._block_arm_value, seq($.expression, ','))),
|
|
1483
|
+
field('body', choice(seq($._block_arm_value, optional(',')), seq($.expression, ','))),
|
|
1483
1484
|
)),
|
|
1484
1485
|
|
|
1485
1486
|
_select_arm_head: $ => choice(
|
package/package.json
CHANGED
package/src/grammar.json
CHANGED
|
@@ -6041,8 +6041,25 @@
|
|
|
6041
6041
|
"type": "CHOICE",
|
|
6042
6042
|
"members": [
|
|
6043
6043
|
{
|
|
6044
|
-
"type": "
|
|
6045
|
-
"
|
|
6044
|
+
"type": "SEQ",
|
|
6045
|
+
"members": [
|
|
6046
|
+
{
|
|
6047
|
+
"type": "SYMBOL",
|
|
6048
|
+
"name": "_block_arm_value"
|
|
6049
|
+
},
|
|
6050
|
+
{
|
|
6051
|
+
"type": "CHOICE",
|
|
6052
|
+
"members": [
|
|
6053
|
+
{
|
|
6054
|
+
"type": "STRING",
|
|
6055
|
+
"value": ","
|
|
6056
|
+
},
|
|
6057
|
+
{
|
|
6058
|
+
"type": "BLANK"
|
|
6059
|
+
}
|
|
6060
|
+
]
|
|
6061
|
+
}
|
|
6062
|
+
]
|
|
6046
6063
|
},
|
|
6047
6064
|
{
|
|
6048
6065
|
"type": "SEQ",
|
|
@@ -9417,8 +9434,25 @@
|
|
|
9417
9434
|
"type": "CHOICE",
|
|
9418
9435
|
"members": [
|
|
9419
9436
|
{
|
|
9420
|
-
"type": "
|
|
9421
|
-
"
|
|
9437
|
+
"type": "SEQ",
|
|
9438
|
+
"members": [
|
|
9439
|
+
{
|
|
9440
|
+
"type": "SYMBOL",
|
|
9441
|
+
"name": "_block_arm_value"
|
|
9442
|
+
},
|
|
9443
|
+
{
|
|
9444
|
+
"type": "CHOICE",
|
|
9445
|
+
"members": [
|
|
9446
|
+
{
|
|
9447
|
+
"type": "STRING",
|
|
9448
|
+
"value": ","
|
|
9449
|
+
},
|
|
9450
|
+
{
|
|
9451
|
+
"type": "BLANK"
|
|
9452
|
+
}
|
|
9453
|
+
]
|
|
9454
|
+
}
|
|
9455
|
+
]
|
|
9422
9456
|
},
|
|
9423
9457
|
{
|
|
9424
9458
|
"type": "SEQ",
|