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