fixed problem with empty statements in function calls

This commit is contained in:
David Halter
2013-07-17 15:05:06 +02:00
parent 2ad3121aa3
commit c0d51e300b

View File

@@ -628,15 +628,18 @@ class Execution(Executable):
stmt._commands = [old] stmt._commands = [old]
# *args # *args
if stmt.get_commands()[0] == '*': commands = stmt.get_commands()
arrays = evaluate.follow_call_list(stmt.get_commands()[1:]) if not len(commands):
continue
if commands[0] == '*':
arrays = evaluate.follow_call_list(commands[1:])
# *args must be some sort of an array, otherwise -> ignore # *args must be some sort of an array, otherwise -> ignore
for array in arrays: for array in arrays:
for field_stmt in array: # yield from plz! for field_stmt in array: # yield from plz!
yield None, field_stmt yield None, field_stmt
# **kwargs # **kwargs
elif stmt.get_commands()[0] == '**': elif commands[0] == '**':
arrays = evaluate.follow_call_list(stmt.get_commands()[1:]) arrays = evaluate.follow_call_list(commands[1:])
for array in arrays: for array in arrays:
for key_stmt, value_stmt in array.items(): for key_stmt, value_stmt in array.items():
# first index, is the key if syntactically correct # first index, is the key if syntactically correct