From bc3fc5d27840e45ab9cf27273bd2ed2ce05e5ef8 Mon Sep 17 00:00:00 2001 From: Tim Sweet Date: Mon, 16 Jun 2025 12:55:02 -0500 Subject: [PATCH] Fixing some try edge cases --- .../control_flow_reconstruction/templates/Exception.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/pylingual/control_flow_reconstruction/templates/Exception.py b/pylingual/control_flow_reconstruction/templates/Exception.py index b8ce4f5..ca87652 100644 --- a/pylingual/control_flow_reconstruction/templates/Exception.py +++ b/pylingual/control_flow_reconstruction/templates/Exception.py @@ -118,7 +118,6 @@ class TryElse3_12(ControlFlowTemplate): @register_template(0, 1, (3, 10)) class Try3_10(ControlFlowTemplate): template = T( - try_header=~N("try_body"), try_body=N("try_footer.", None, "except_body"), try_footer=~N("tail."), except_body=~N("tail.").of_subtemplate(Except3_10), @@ -130,7 +129,6 @@ class Try3_10(ControlFlowTemplate): { EdgeKind.Fall: "tail", }, - "try_header", "try_body", "except_body", "try_footer", @@ -140,7 +138,6 @@ class Try3_10(ControlFlowTemplate): @to_indented_source def to_indented_source(): """ - {try_header} try: {try_body} {except_body} @@ -149,7 +146,6 @@ class Try3_10(ControlFlowTemplate): @register_template(0, 0, (3, 10)) class TryElse3_10(ControlFlowTemplate): template = T( - try_header=N("try_body"), try_body=N("try_footer.", None, "except_body"), try_footer=N("else_body").with_in_deg(1), except_body=N("tail.").with_in_deg(1).of_subtemplate(Except3_10), @@ -162,7 +158,6 @@ class TryElse3_10(ControlFlowTemplate): { EdgeKind.Fall: "tail", }, - "try_header", "try_body", "try_footer", "except_body", @@ -173,7 +168,6 @@ class TryElse3_10(ControlFlowTemplate): @to_indented_source def to_indented_source(): """ - {try_header} try: {try_body} {except_body} @@ -206,7 +200,7 @@ class NamedExc3_10(ExcBody3_10): class BareExcept3_10(Except3_10): template = T( - except_body=~N("tail.", None).of_type(BlockTemplate).with_cond(with_instructions("POP_EXCEPT")), + except_body=~N("tail.", None).of_type(BlockTemplate).with_cond(with_instructions("POP_EXCEPT"), with_instructions("RAISE_VARARGS")), tail=N.tail(), )