pass
-class Assign(Dataclass):
+class AssignExpr(Dataclass):
lvalue: Node
rvalue: Node
-class AssignIEA(Assign):
+class AssignIEAExpr(AssignExpr):
lvalue: Node
rvalue: Node
else:
(lvalue, rvalue) = (p[1], p[3])
if isinstance(p[2], pc_ast.AssignOp):
- cls = pc_ast.Assign
+ cls = pc_ast.AssignExpr
else:
- cls = pc_ast.AssignIEA
+ cls = pc_ast.AssignIEAExpr
if (isinstance(lvalue, pc_ast.Symbol) and
(str(lvalue) in self.__class__.REGS)):
lvalue = self.__class__.REGS[str(lvalue)](lvalue)
stmt = f"{node.name}({args})"
self[node].emit(stmt=stmt)
- @Hook(pc_ast.Assign, pc_ast.AssignIEA)
- def Assign(self, node):
+ @Hook(pc_ast.AssignExpr, pc_ast.AssignIEAExpr)
+ def AssignExpr(self, node):
mapping = {
- pc_ast.Assign: "<-",
- pc_ast.AssignIEA: "<-iea",
+ pc_ast.AssignExpr: "<-",
+ pc_ast.AssignIEAExpr: "<-iea",
}
yield node
lvalue = str(self[node.lvalue])