@pc_util.Hook(pc_ast.Call)
def Call(self, node):
yield node
- code = tuple(map(lambda arg: self[arg], node.args))
- call = self.call(name=str(node.name), code=code)
- for (level, stmt) in self[call]:
- self[node].emit(stmt=stmt, level=level)
+ if node.args:
+ transient = self.transient()
+ code = [self[transient]]
+ else:
+ code = []
+ code.extend(map(lambda arg: self[arg], node.args))
+ name = f"OPPC_CALL_{str(node.name)}"
+ with self.pseudocode(node=node):
+ call = self.call(name=name, code=code)
+ for (level, stmt) in self[call]:
+ self[node].emit(stmt=stmt, level=level)
@pc_util.Hook(pc_ast.Attribute.Name)
def AttributeName(self, node):