Skip to content

Commit 89f88fa

Browse files
committed
Correctly track bailouts in parenthesized binary expressions
1 parent 0e07372 commit 89f88fa

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/fixup.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@ fn scan_right(
510510
return consume_by_precedence;
511511
}
512512
match expr {
513-
Expr::Assign(e) => {
513+
Expr::Assign(e) if e.attrs.is_empty() => {
514514
if match fixup.next_operator {
515515
Precedence::Unambiguous => fail_offset >= 2,
516516
_ => bailout_offset >= 1,
@@ -536,7 +536,7 @@ fn scan_right(
536536
Scan::Bailout
537537
}
538538
}
539-
Expr::Binary(e) => {
539+
Expr::Binary(e) if e.attrs.is_empty() => {
540540
if match fixup.next_operator {
541541
Precedence::Unambiguous => {
542542
fail_offset >= 2
@@ -732,8 +732,10 @@ fn scan_right(
732732
}
733733
}
734734
Expr::Array(_)
735+
| Expr::Assign(_)
735736
| Expr::Async(_)
736737
| Expr::Await(_)
738+
| Expr::Binary(_)
737739
| Expr::Block(_)
738740
| Expr::Call(_)
739741
| Expr::Cast(_)

0 commit comments

Comments
 (0)