Skip to content

Commit 775670e

Browse files
committed
Split the test
1 parent b90ed92 commit 775670e

File tree

3 files changed

+42
-2
lines changed

3 files changed

+42
-2
lines changed

crates/parser/src/grammar/patterns.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,20 @@ fn pattern_single_r(p: &mut Parser, recovery_set: TokenSet) {
6969
// 302 .. => (),
7070
// }
7171
// }
72+
73+
// FIXME: support half_open_range_patterns (`..=2`),
74+
// exclusive_range_pattern (`..5`) with missing lhs
7275
for &range_op in [T![...], T![..=], T![..]].iter() {
7376
if p.at(range_op) {
7477
let m = lhs.precede(p);
7578
p.bump(range_op);
76-
if !p.at(T![=>]) {
77-
// not a range pat like `302 .. => ()`
79+
80+
// `0 .. =>` or `let 0 .. =`
81+
// ^ ^
82+
if p.at(T![=]) {
83+
// test half_open_range_pat
84+
// fn f() { let 0 .. = 1u32; }
85+
} else {
7886
atom_pat(p, recovery_set);
7987
}
8088
m.complete(p, RANGE_PAT);
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
fn f() { let 0 .. = 1u32; }

0 commit comments

Comments
 (0)