From 20bbe0127cc6bfac3ced0c7ed1de4f0526f3bbed Mon Sep 17 00:00:00 2001 From: DJMcNab <36049421+DJMcNab@users.noreply.github.com> Date: Mon, 17 Dec 2018 22:34:18 +0000 Subject: Fix parsing of inclusive ranges (#214) I'm not certain that this is correct, so extra eyes would be good --- crates/ra_syntax/src/grammar/patterns.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'crates/ra_syntax/src/grammar/patterns.rs') diff --git a/crates/ra_syntax/src/grammar/patterns.rs b/crates/ra_syntax/src/grammar/patterns.rs index 10fa0e0be..64cdf0b1b 100644 --- a/crates/ra_syntax/src/grammar/patterns.rs +++ b/crates/ra_syntax/src/grammar/patterns.rs @@ -14,9 +14,13 @@ pub(super) fn pattern_r(p: &mut Parser, recovery_set: TokenSet) { if let Some(lhs) = atom_pat(p, recovery_set) { // test range_pat // fn main() { - // match 92 { 0 ... 100 => () } + // match 92 { + // 0 ... 100 => (), + // 101 ..= 200 => (), + // 200 .. 301=> (), + // } // } - if p.at(DOTDOTDOT) { + if p.at(DOTDOTDOT) || p.at(DOTDOTEQ) || p.at(DOTDOT) { let m = lhs.precede(p); p.bump(); atom_pat(p, recovery_set); -- cgit v1.2.3