Commit bca5e85c authored by Stefan Behnel's avatar Stefan Behnel

small cleanup in parser

parent 068e22c3
...@@ -84,12 +84,9 @@ def p_simple_expr(s): ...@@ -84,12 +84,9 @@ def p_simple_expr(s):
if s.sy == 'if': if s.sy == 'if':
s.next() s.next()
test = p_or_test(s) test = p_or_test(s)
if s.sy == 'else': s.expect('else')
s.next() other = p_test(s)
other = p_test(s) return ExprNodes.CondExprNode(pos, test=test, true_val=expr, false_val=other)
return ExprNodes.CondExprNode(pos, test=test, true_val=expr, false_val=other)
else:
s.error("Expected 'else'")
else: else:
return expr return expr
......
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