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):
if s.sy == 'if':
s.next()
test = p_or_test(s)
if s.sy == 'else':
s.next()
other = p_test(s)
return ExprNodes.CondExprNode(pos, test=test, true_val=expr, false_val=other)
else:
s.error("Expected 'else'")
s.expect('else')
other = p_test(s)
return ExprNodes.CondExprNode(pos, test=test, true_val=expr, false_val=other)
else:
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