Skip to content

Commit 95e7208

Browse files
committed
new opt.
1 parent aa6bbd6 commit 95e7208

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tools/brus16_dsl.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,10 @@ def trans_expr(env, node, is_data=False):
9696
case ast.UnaryOp(op, x):
9797
return [*trans_expr(env, x), UNOPS[type(op)]]
9898
case ast.BinOp(x, op, y) | ast.Compare(x, [op], [y]):
99-
x = trans_expr(env, x)
100-
y = trans_expr(env, y)
10199
if type(op) in COMMOPS and isinstance(x, ast.Constant):
102100
x, y = y, x
101+
x = trans_expr(env, x)
102+
y = trans_expr(env, y)
103103
return [*x, *y, (BINOPS[type(op)],)]
104104
case ast.Call(ast.Name(name), args):
105105
assert env.get(name) == ('func', len(args)) or name in MACROS, \

0 commit comments

Comments
 (0)