File tree Expand file tree Collapse file tree 7 files changed +70122
-60820
lines changed Expand file tree Collapse file tree 7 files changed +70122
-60820
lines changed Original file line number Diff line number Diff line change @@ -108,6 +108,7 @@ match x {
108
108
a @ A(_) | b @ B(..) => a,
109
109
a @ 1 ... 5 => a,
110
110
Some(1 ... 5) => a,
111
+ a @ b...c => a,
111
112
}
112
113
113
114
---
@@ -126,4 +127,7 @@ match x {
126
127
(match_arm
127
128
(match_pattern
128
129
(tuple_struct_pattern (identifier) (range_pattern (integer_literal) (integer_literal))))
130
+ (identifier))
131
+ (match_arm
132
+ (match_pattern (captured_pattern (identifier) (range_pattern (identifier) (identifier))))
129
133
(identifier)))))
Original file line number Diff line number Diff line change @@ -1202,9 +1202,15 @@ module.exports = grammar({
1202
1202
) ) ,
1203
1203
1204
1204
range_pattern : $ => seq (
1205
- $ . _literal_pattern ,
1205
+ choice (
1206
+ $ . _literal_pattern ,
1207
+ $ . _path ,
1208
+ ) ,
1206
1209
'...' ,
1207
- $ . _literal_pattern
1210
+ choice (
1211
+ $ . _literal_pattern ,
1212
+ $ . _path ,
1213
+ ) ,
1208
1214
) ,
1209
1215
1210
1216
ref_pattern : $ => seq (
Original file line number Diff line number Diff line change 13
13
"nan" : " ^2.8.0"
14
14
},
15
15
"devDependencies" : {
16
- "tree-sitter-cli" : " ^0.15.3 "
16
+ "tree-sitter-cli" : " ^0.15.6 "
17
17
},
18
18
"scripts" : {
19
19
"test" : " tree-sitter test && script/parse-examples" ,
Original file line number Diff line number Diff line change 6596
6596
"type" : " SEQ" ,
6597
6597
"members" : [
6598
6598
{
6599
- "type" : " SYMBOL" ,
6600
- "name" : " _literal_pattern"
6599
+ "type" : " CHOICE" ,
6600
+ "members" : [
6601
+ {
6602
+ "type" : " SYMBOL" ,
6603
+ "name" : " _literal_pattern"
6604
+ },
6605
+ {
6606
+ "type" : " SYMBOL" ,
6607
+ "name" : " _path"
6608
+ }
6609
+ ]
6601
6610
},
6602
6611
{
6603
6612
"type" : " STRING" ,
6604
6613
"value" : " ..."
6605
6614
},
6606
6615
{
6607
- "type" : " SYMBOL" ,
6608
- "name" : " _literal_pattern"
6616
+ "type" : " CHOICE" ,
6617
+ "members" : [
6618
+ {
6619
+ "type" : " SYMBOL" ,
6620
+ "name" : " _literal_pattern"
6621
+ },
6622
+ {
6623
+ "type" : " SYMBOL" ,
6624
+ "name" : " _path"
6625
+ }
6626
+ ]
6609
6627
}
6610
6628
]
6611
6629
},
You can’t perform that action at this time.
0 commit comments