diff --git a/pylingual/control_flow_reconstruction/templates/Conditional.py b/pylingual/control_flow_reconstruction/templates/Conditional.py index a2b3d25..fe2b603 100644 --- a/pylingual/control_flow_reconstruction/templates/Conditional.py +++ b/pylingual/control_flow_reconstruction/templates/Conditional.py @@ -1,9 +1,5 @@ from ..cft import ControlFlowTemplate, EdgeKind, register_template -<<<<<<< Updated upstream -from ..utils import T, N, defer_source_to, run_is, with_instructions, has_instval, starting_instructions, to_indented_source, make_try_match, without_top_level_instructions -======= from ..utils import T, N, defer_source_to, run_is, has_no_lines, with_instructions, has_instval, starting_instructions, to_indented_source, make_try_match, without_top_level_instructions ->>>>>>> Stashed changes @register_template(1, 40) @@ -50,17 +46,10 @@ class IfThen(ControlFlowTemplate): class Assertion(ControlFlowTemplate): template = T( assertion=~N("fail", "tail"), -<<<<<<< Updated upstream - fail=+N().with_cond(starting_instructions("LOAD_ASSERTION_ERROR"), has_instval("LOAD_GLOBAL", argval = "AssertionError")), - tail=N.tail(), -======= fail=+N().with_cond(starting_instructions("LOAD_ASSERTION_ERROR"), has_instval("LOAD_GLOBAL", argval = "AssertionError")).with_cond(has_no_lines), - tail=N.tail().with_cond(without_top_level_instructions("RERAISE", "END_FINALLY")), ->>>>>>> Stashed changes + tail=N.tail(), ) - - try_match = make_try_match({EdgeKind.Fall: "tail"}, "assertion", "fail") to_indented_source = defer_source_to("assertion") diff --git a/pylingual/control_flow_reconstruction/utils.py b/pylingual/control_flow_reconstruction/utils.py index c193712..f7d08b4 100644 --- a/pylingual/control_flow_reconstruction/utils.py +++ b/pylingual/control_flow_reconstruction/utils.py @@ -129,13 +129,10 @@ def has_instval(opname: str, argval : Any): return check_instructions -<<<<<<< Updated upstream -======= def has_no_lines(cfg: CFG, node: ControlFlowTemplate | None) -> bool: return node is None or all(i.starts_line is None for i in node.get_instructions()) ->>>>>>> Stashed changes def run_is(n: int): def check_run(cfg: CFG, node: ControlFlowTemplate | None) -> bool: return cfg.run == n