fix bitwise precedence
This commit is contained in:
parent
4b6f6a127f
commit
5010a9584c
|
|
@ -380,23 +380,25 @@ export const precedence: Record<string, number> = {
|
||||||
// Nullish coalescing
|
// Nullish coalescing
|
||||||
'??': 35,
|
'??': 35,
|
||||||
|
|
||||||
|
// Bitwise shifts (lower precedence than addition)
|
||||||
|
'<<': 37,
|
||||||
|
'>>': 37,
|
||||||
|
'>>>': 37,
|
||||||
|
|
||||||
// Addition/Subtraction
|
// Addition/Subtraction
|
||||||
'+': 40,
|
'+': 40,
|
||||||
'-': 40,
|
'-': 40,
|
||||||
|
|
||||||
|
// Bitwise AND/OR/XOR (higher precedence than addition)
|
||||||
|
'band': 45,
|
||||||
|
'bor': 45,
|
||||||
|
'bxor': 45,
|
||||||
|
|
||||||
// Multiplication/Division/Modulo
|
// Multiplication/Division/Modulo
|
||||||
'*': 50,
|
'*': 50,
|
||||||
'/': 50,
|
'/': 50,
|
||||||
'%': 50,
|
'%': 50,
|
||||||
|
|
||||||
// Bitwise
|
|
||||||
'band': 45,
|
|
||||||
'bor': 45,
|
|
||||||
'bxor': 45,
|
|
||||||
'<<': 45,
|
|
||||||
'>>': 45,
|
|
||||||
'>>>': 45,
|
|
||||||
|
|
||||||
// Exponentiation (right-associative)
|
// Exponentiation (right-associative)
|
||||||
'**': 60,
|
'**': 60,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user