Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/util/codegen.py
diff options
context:
space:
mode:
Diffstat (limited to 'util/codegen.py')
-rw-r--r--util/codegen.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/util/codegen.py b/util/codegen.py
index 46184e7..babada1 100644
--- a/util/codegen.py
+++ b/util/codegen.py
@@ -447,9 +447,14 @@ class SourceGenerator(NodeVisitor):
self.write('}')
def visit_BinOp(self, node):
+ op = self.BINOP_SYMBOLS[node.op]
+ # if op in ['+', '-']:
+ self.write('(')
self.visit(node.left)
- self.write(' %s ' % self.BINOP_SYMBOLS[node.op])
+ self.write(' %s ' % op)
self.visit(node.right)
+ # if op in ['+', '-']:
+ self.write(')')
def visit_BoolOp(self, node):
self.write('(')