mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-11-20 03:49:51 +00:00
Split the test
This commit is contained in:
parent
b90ed92a5c
commit
775670e32c
3 changed files with 42 additions and 2 deletions
|
|
@ -69,12 +69,20 @@ fn pattern_single_r(p: &mut Parser, recovery_set: TokenSet) {
|
|||
// 302 .. => (),
|
||||
// }
|
||||
// }
|
||||
|
||||
// FIXME: support half_open_range_patterns (`..=2`),
|
||||
// exclusive_range_pattern (`..5`) with missing lhs
|
||||
for &range_op in [T![...], T![..=], T![..]].iter() {
|
||||
if p.at(range_op) {
|
||||
let m = lhs.precede(p);
|
||||
p.bump(range_op);
|
||||
if !p.at(T![=>]) {
|
||||
// not a range pat like `302 .. => ()`
|
||||
|
||||
// `0 .. =>` or `let 0 .. =`
|
||||
// ^ ^
|
||||
if p.at(T![=]) {
|
||||
// test half_open_range_pat
|
||||
// fn f() { let 0 .. = 1u32; }
|
||||
} else {
|
||||
atom_pat(p, recovery_set);
|
||||
}
|
||||
m.complete(p, RANGE_PAT);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue