node = p[2]
while isinstance(node.subject, attribute_or_subscript):
node = node.subject
- if isinstance(node.subject, pc_ast.Arguments):
- node.subject = pc_ast.Call(name=p[1], args=node.subject)
+ if isinstance(node.subject, pc_ast.Call.Arguments):
+ name = pc_ast.Call.Name(str(p[1]))
+ node.subject = pc_ast.Call(name=name, args=node.subject)
else:
node.subject = p[1]
p[0] = p[2]
- elif isinstance(p[2], pc_ast.Arguments):
- p[0] = pc_ast.Call(name=p[1], args=p[2])
+ elif isinstance(p[2], pc_ast.Call.Arguments):
+ name = pc_ast.Call.Name(str(p[1]))
+ p[0] = pc_ast.Call(name=name, args=p[2])
else:
raise NotImplementedError()
| LPAR RPAR
"""
if len(p) == 3:
- p[0] = pc_ast.Arguments()
+ p[0] = pc_ast.Call.Arguments()
else:
p[0] = p[2]
| argument
"""
if len(p) == 4:
- p[0] = pc_ast.Arguments(p[1] + (p[3],))
+ p[0] = pc_ast.Call.Arguments(p[1] + (p[3],))
else:
- p[0] = pc_ast.Arguments([p[1]])
+ p[0] = pc_ast.Call.Arguments([p[1]])
# argument: test [gen_for] | test '=' test # Really [keyword '='] test
def p_argument(self, p):