Skip to content

Commit 4944362

Browse files
committed
Fix parenthesization of chained comparisons containing bailout
1 parent fd198d9 commit 4944362

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/fixup.rs

+3
Original file line numberDiff line numberDiff line change
@@ -547,6 +547,9 @@ fn scan_right(
547547
return Scan::Consume;
548548
}
549549
let binop_prec = Precedence::of_binop(&e.op);
550+
if binop_prec == Precedence::Compare && fixup.next_operator == Precedence::Compare {
551+
return Scan::Consume;
552+
}
550553
let right_fixup = fixup.rightmost_subexpression_fixup(false, false, binop_prec);
551554
let scan = scan_right(
552555
&e.right,

0 commit comments

Comments
 (0)