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/expressions.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/ra_syntax/src/grammar/expressions.rs') diff --git a/crates/ra_syntax/src/grammar/expressions.rs b/crates/ra_syntax/src/grammar/expressions.rs index a9449c7bf..bca32f707 100644 --- a/crates/ra_syntax/src/grammar/expressions.rs +++ b/crates/ra_syntax/src/grammar/expressions.rs @@ -143,7 +143,7 @@ fn current_op(p: &Parser) -> (u8, Op) { let bp = match p.current() { EQ => 1, - DOTDOT => 2, + DOTDOT | DOTDOTEQ => 2, EQEQ | NEQ | L_ANGLE | R_ANGLE => 5, PIPE => 6, CARET => 7, @@ -173,7 +173,7 @@ fn expr_bp(p: &mut Parser, r: Restrictions, bp: u8) -> BlockLike { }; loop { - let is_range = p.current() == DOTDOT; + let is_range = p.current() == DOTDOT || p.current() == DOTDOTEQ; let (op_bp, op) = current_op(p); if op_bp < bp { break; -- cgit v1.2.3