Commit 49a93dc0 authored by Taddeüs Kroes's avatar Taddeüs Kroes

Code cleanup.

parent 8349bc37
...@@ -236,6 +236,7 @@ def generate_line(root): ...@@ -236,6 +236,7 @@ def generate_line(root):
left, right = node left, right = node
lstr = content[left] lstr = content[left]
rstr = content[right] rstr = content[right]
lpred = pred(left) lpred = pred(left)
rpred = pred(right) rpred = pred(right)
lparens = rparens = False lparens = rparens = False
...@@ -255,16 +256,16 @@ def generate_line(root): ...@@ -255,16 +256,16 @@ def generate_line(root):
elif is_left_assoc(right.title()): elif is_left_assoc(right.title()):
rparens = True rparens = True
# Check if multiplication sign is necessary
if op == '*' and not unary_right:
sep = mult_sign(left, right, lparens, rparens)
if lparens: if lparens:
lstr = '(' + lstr + ')' lstr = '(' + lstr + ')'
if rparens: if rparens:
rstr = '(' + rstr + ')' rstr = '(' + rstr + ')'
# Check if multiplication sign is necessary
if op == '*' and not unary_right:
sep = mult_sign(left, right, lparens, rparens)
return lstr + sep + rstr return lstr + sep + rstr
def construct_nary_mult(node): def construct_nary_mult(node):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment