Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/parser/src/grammar/patterns.rs')
| -rw-r--r-- | crates/parser/src/grammar/patterns.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/crates/parser/src/grammar/patterns.rs b/crates/parser/src/grammar/patterns.rs index 8de42c99ee..abcefffa23 100644 --- a/crates/parser/src/grammar/patterns.rs +++ b/crates/parser/src/grammar/patterns.rs @@ -126,6 +126,8 @@ fn pattern_single_r(p: &mut Parser<'_>, recovery_set: TokenSet) { // ^ // `[0..]` // ^ + // `0 .. if` + // ^ if matches!( p.current(), T![=] | T![,] | T![:] | T![')'] | T!['}'] | T![']'] | T![if] @@ -134,6 +136,11 @@ fn pattern_single_r(p: &mut Parser<'_>, recovery_set: TokenSet) { // fn f() { // let 0 .. = 1u32; // let 0..: _ = 1u32; + // + // match 42 { + // 0 .. if true => (), + // _ => (), + // } // } } else { atom_pat(p, recovery_set); |