right = f"oppc_reg_fetch({str(self[node.right])})"
else:
right = str(self[node.right])
- if isinstance(node.op, (pc_ast.Add, pc_ast.Sub)):
+ if isinstance(node.op, (pc_ast.Add, pc_ast.Sub,
+ pc_ast.Mul, pc_ast.Div, pc_ast.Mod)):
op = {
pc_ast.Not: "~",
pc_ast.Add: "+",
pc_ast.Sub: "-",
+ pc_ast.Mul: "*",
+ pc_ast.Div: "/",
+ pc_ast.Mod: "%",
}[node.op.__class__]
stmt = " ".join([left, op, right])
self[node].emit(stmt=f"({stmt})")
else:
raise ValueError(node)
- @pc_util.Hook(pc_ast.Not, pc_ast.Add, pc_ast.Sub)
+ @pc_util.Hook(pc_ast.Not, pc_ast.Add, pc_ast.Sub,
+ pc_ast.Mul, pc_ast.Div, pc_ast.Mod)
def Op(self, node):
yield node