Skip to content

Commit fd198d9

Browse files
committed
Generalize Expr::Range bailout to any operator that can begin expr
1 parent d3f2879 commit fd198d9

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/fixup.rs

+7-4
Original file line numberDiff line numberDiff line change
@@ -639,10 +639,13 @@ fn scan_right(
639639
Scan::Fail
640640
}
641641
}
642-
None => match fixup.next_operator {
643-
Precedence::Range => Scan::Consume,
644-
_ => Scan::Fail,
645-
},
642+
None => {
643+
if fixup.next_operator_can_begin_expr {
644+
Scan::Consume
645+
} else {
646+
Scan::Fail
647+
}
648+
}
646649
},
647650
Expr::Break(e) => match &e.expr {
648651
Some(value) => {

0 commit comments

Comments
 (0)