mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 22:54:58 +00:00
Fix parsing of inclusive ranges (#214)
I'm not certain that this is correct, so extra eyes would be good
This commit is contained in:
parent
0bd9d87e87
commit
20bbe0127c
6 changed files with 158 additions and 37 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue