You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-03 16:59:52 +08:00
2.7 ifelsestmt reduction rule futzing
This commit is contained in:
@@ -125,7 +125,9 @@ def ifelsestmt(self, lhs, n, rule, ast, tokens, first, last):
|
|||||||
if jump_forward == "jf_cf_pop":
|
if jump_forward == "jf_cf_pop":
|
||||||
jump_forward = jump_forward[0]
|
jump_forward = jump_forward[0]
|
||||||
|
|
||||||
|
jump_to_jump = False
|
||||||
if jump_forward == "JUMP_FORWARD":
|
if jump_forward == "JUMP_FORWARD":
|
||||||
|
jump_to_jump = True
|
||||||
endif_target = int(jump_forward.pattr)
|
endif_target = int(jump_forward.pattr)
|
||||||
last_offset = tokens[last].off2int()
|
last_offset = tokens[last].off2int()
|
||||||
if endif_target != last_offset:
|
if endif_target != last_offset:
|
||||||
@@ -143,7 +145,7 @@ def ifelsestmt(self, lhs, n, rule, ast, tokens, first, last):
|
|||||||
# if jmp_target < else_suite.first_child().off2int():
|
# if jmp_target < else_suite.first_child().off2int():
|
||||||
# return True
|
# return True
|
||||||
|
|
||||||
if tokens[first].off2int() > jmp_target:
|
if tokens[first].off2int() > jmp_target and not jump_to_jump:
|
||||||
return True
|
return True
|
||||||
|
|
||||||
return (jmp_target > tokens[last].off2int()) and tokens[
|
return (jmp_target > tokens[last].off2int()) and tokens[
|
||||||
|
Reference in New Issue
Block a user