oppc/code: support leave keyword
authorDmitry Selyutin <ghostmansd@gmail.com>
Sun, 14 Jan 2024 14:43:19 +0000 (17:43 +0300)
committerDmitry Selyutin <ghostmansd@gmail.com>
Tue, 16 Jan 2024 19:10:07 +0000 (22:10 +0300)
src/openpower/oppc/pc_code.py

index bbacaff1464976c1f17be9aa59b5998e150f6efc..22adf1e51427006a8b85a6c2f9d646818b08baf6 100644 (file)
@@ -462,6 +462,11 @@ class CodeVisitor(pc_util.Visitor):
         yield node
         self[node].emit(stmt=str(node))
 
+    @pc_util.Hook(pc_ast.LeaveKeyword)
+    def LeaveKeyword(self, node):
+        yield node
+        self[node].emit(stmt="break;")
+
     @pc_util.Hook(pc_ast.Call.Name)
     def CallName(self, node):
         yield node