oppc/pseudocode: always use keywords for emit calls
authorDmitry Selyutin <ghostmansd@gmail.com>
Sun, 14 Jan 2024 13:50:30 +0000 (16:50 +0300)
committerDmitry Selyutin <ghostmansd@gmail.com>
Tue, 16 Jan 2024 19:10:07 +0000 (22:10 +0300)
src/openpower/oppc/pc_pseudocode.py

index b9d1b96434ce9522435a86e7db9c75f2cf47fd94..074d4c0d9b5f4537c3bc2472919f8c243cfd8335 100644 (file)
@@ -95,7 +95,7 @@ class PseudocodeVisitor(pc_util.Visitor):
         for (level, stmt) in self[node.body]:
             self[node].emit(stmt=stmt, level=level)
         if node.orelse:
-            self[node].emit("else")
+            self[node].emit(stmt="else")
             for (level, stmt) in self[node.orelse]:
                 self[node].emit(stmt=stmt, level=level)
 
@@ -126,7 +126,7 @@ class PseudocodeVisitor(pc_util.Visitor):
         for (level, stmt) in self[node.body]:
             self[node].emit(stmt=stmt, level=level)
         if node.orelse:
-            self[node].emit("else")
+            self[node].emit(stmt="else")
             for (level, stmt) in self[node.orelse]:
                 self[node].emit(stmt=stmt, level=level)
 
@@ -143,7 +143,7 @@ class PseudocodeVisitor(pc_util.Visitor):
     @pc_util.Hook(pc_ast.SwitchExpr)
     def SwitchExpr(self, node):
         yield node
-        self[node].emit(f"switch({str(self[node.subject])})")
+        self[node].emit(stmt=f"switch({str(self[node.subject])})")
         with self[node]:
             for (level, stmt) in self[node.cases]:
                 self[node].emit(stmt=stmt, level=level)