Refine 2.7 control flow reduction tests...

for "iflastsmtl" and "and"
This commit is contained in:
rocky
2019-11-18 11:34:06 -05:00
parent d696443eb2
commit cc856e2b95

View File

@@ -248,6 +248,8 @@ class Python27Parser(Python2Parser):
# an optimization where the "and" jump_false is back to a loop.
jmp_false = ast[1]
if jmp_false[0] == "POP_JUMP_IF_FALSE":
while (first < last and isinstance(tokens[last].offset, str)):
last -= 1
if jmp_false[0].attr < tokens[last].offset:
return True
@@ -295,7 +297,7 @@ class Python27Parser(Python2Parser):
return True
while (first < last and isinstance(tokens[last].offset, str)):
last -= 1
return jmp_false[0].attr < tokens[last].offset
return tokens[first].offset < jmp_false[0].attr < tokens[last].offset
pass
pass
pass