Adjust 3.x while1else reduction check

This commit is contained in:
rocky
2018-03-20 11:33:10 -04:00
parent 0e64111195
commit 90ac8a463d
4 changed files with 15 additions and 2 deletions

View File

@@ -1090,7 +1090,7 @@ class Python3Parser(PythonParser):
if tokens[last] in ('JUMP_BACK', 'CONTINUE'):
# These indicate inside a loop, but token[last]
# should not be in a loop.
# FIXME: Not quite righte: refine by using target
# FIXME: Not quite right: refine by using target
return True
# if SETUP_LOOP target spans the else part, then this is
@@ -1100,7 +1100,7 @@ class Python3Parser(PythonParser):
last += 1
if last == n:
return False
return tokens[first].attr >= tokens[last].offset
return tokens[first].attr > tokens[last].offset
elif lhs == 'while1stmt':
# If there is a fall through to the COME_FROM_LOOP. then this is