Skip to content

Commit d105f21

Browse files
committed
CommonOps: multiply all precedences by 10x to allow some interval in between values in case we'll ever need that
1 parent f93fa66 commit d105f21

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

shared/src/main/scala/io/kaitai/struct/translators/CommonOps.scala

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,16 @@ trait CommonOps extends AbstractTranslator {
1414
* @see https://docs.python.org/3/reference/expressions.html#operator-precedence
1515
*/
1616
val OPERATOR_PRECEDENCE = Map[Ast.operator, Int](
17-
Ast.operator.Mult -> 13,
18-
Ast.operator.Div -> 13,
19-
Ast.operator.Mod -> 13,
20-
Ast.operator.Add -> 12,
21-
Ast.operator.Sub -> 12,
22-
Ast.operator.LShift -> 11,
23-
Ast.operator.RShift -> 11,
24-
Ast.operator.BitAnd -> 10,
25-
Ast.operator.BitXor -> 9,
26-
Ast.operator.BitOr -> 8,
17+
Ast.operator.Mult -> 130,
18+
Ast.operator.Div -> 130,
19+
Ast.operator.Mod -> 130,
20+
Ast.operator.Add -> 120,
21+
Ast.operator.Sub -> 120,
22+
Ast.operator.LShift -> 110,
23+
Ast.operator.RShift -> 110,
24+
Ast.operator.BitAnd -> 100,
25+
Ast.operator.BitXor -> 90,
26+
Ast.operator.BitOr -> 80,
2727
)
2828

2929
def genericBinOp(left: Ast.expr, op: Ast.operator, right: Ast.expr, extPrec: Int): String =

0 commit comments

Comments
 (0)