Python 3 while/else bug

This commit is contained in:
rocky
2016-11-27 07:02:17 -05:00
parent 1e324e0e8d
commit 97576e473d
4 changed files with 21 additions and 9 deletions

View File

@@ -324,9 +324,10 @@ class Scanner3(Scanner):
# FIXME: this is a hack to catch stuff like:
# if x: continue
# the "continue" is not on a new line.
# There are other situations were we don't catch
# There are other situations where we don't catch
# CONTINUE as well.
if tokens[-1].type == 'JUMP_BACK':
if tokens[-1].type == 'JUMP_BACK' and tokens[-1].attr <= argval:
# intern is used because we are changing the *previous* token
tokens[-1].type = intern('CONTINUE')
elif op == self.opc.RETURN_VALUE: