Skip to content
Snippets Groups Projects
Commit 29d4ac5c authored by Andreas Klöckner's avatar Andreas Klöckner
Browse files

Fix parsing of function calls after the addition of tuples.

parent 8e86cab6
No related branches found
No related tags found
No related merge requests found
......@@ -115,5 +115,3 @@ def evaluate_kw(expression, **context):
def evaluate_to_float(expression, context={}):
return FloatEvaluationMapper(context)(expression)
......@@ -63,13 +63,6 @@ def parse(expr_str):
else:
pstate.expected("terminal")
def parse_expr_list(pstate):
result = [parse_expression(pstate)]
while pstate.next_tag() is _comma:
pstate.advance()
result.append(parse_expression(pstate))
return result
def parse_expression(pstate, min_precedence=0):
pstate.expect_not_end()
......@@ -99,8 +92,10 @@ def parse(expr_str):
pstate.advance()
left_exp = primitives.Call(left_exp, ())
else:
left_exp = primitives.Call(left_exp,
tuple(parse_expr_list(pstate)))
args = parse_expression(pstate, _PREC_PLUS)
if not isinstance(args, tuple):
args = (args,)
left_exp = primitives.Call(left_exp, args)
pstate.expect(_closepar)
pstate.advance()
did_something = True
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment