mirror of
https://github.com/syssec-utd/pylingual.git
synced 2026-05-10 18:39:03 -07:00
format
This commit is contained in:
@@ -58,14 +58,17 @@ class RemoveUnreachable(ControlFlowTemplate):
|
||||
class JumpTemplate(ControlFlowTemplate):
|
||||
template = T(
|
||||
body=~N("jump", None).with_cond(without_instructions("CLEANUP_THROW")),
|
||||
jump=N("tail", "block?").with_in_deg(1).with_cond(
|
||||
jump=N("tail", "block?")
|
||||
.with_in_deg(1)
|
||||
.with_cond(
|
||||
exact_instructions("JUMP_BACKWARD_NO_INTERRUPT"),
|
||||
exact_instructions("POP_JUMP_IF_TRUE"),
|
||||
exact_instructions("JUMP_FORWARD"),
|
||||
exact_instructions("JUMP_BACKWARD"),
|
||||
exact_instructions("POP_JUMP_IF_NOT_NONE"),
|
||||
exact_instructions("POP_JUMP_IF_NONE"),
|
||||
exact_instructions("POP_JUMP_IF_FALSE")),
|
||||
exact_instructions("POP_JUMP_IF_FALSE"),
|
||||
),
|
||||
block=N.tail(),
|
||||
tail=N.tail(),
|
||||
)
|
||||
@@ -81,6 +84,7 @@ class JumpTemplate(ControlFlowTemplate):
|
||||
|
||||
to_indented_source = defer_source_to("body")
|
||||
|
||||
|
||||
@register_template(0, 0, *versions_from(3, 11))
|
||||
class NopTemplate(ControlFlowTemplate):
|
||||
template = T(
|
||||
|
||||
@@ -309,12 +309,14 @@ def g1_ifElseLoop():
|
||||
if a > b:
|
||||
print(1)
|
||||
|
||||
|
||||
def g2_ifElseLoop():
|
||||
for a in range(3):
|
||||
if a > b:
|
||||
print(1)
|
||||
print(2)
|
||||
|
||||
|
||||
def g3_ifElseLoop():
|
||||
for a in range(3):
|
||||
if a > b:
|
||||
|
||||
Reference in New Issue
Block a user