3.x while/else can now sometime have COME_FROMs

This commit is contained in:
rocky
2019-04-27 04:37:24 -04:00
parent 43dbf9b878
commit c5d7944e65
2 changed files with 7 additions and 3 deletions

View File

@@ -39,7 +39,7 @@ python_versions = [v for v in magics.python_versions if
TEST_VERSIONS = (
'pypy3-2.4.0', 'pypy-2.6.1',
'pypy-5.0.1', 'pypy-5.3.1', 'pypy3.5-5.7.1-beta',
'pypy3.5-5.9.0',
'pypy3.5-5.9.0', 'pypy3.5-6.0.0',
'native') + tuple(python_versions)
@@ -60,7 +60,11 @@ test_options = {
for vers in TEST_VERSIONS:
if vers.startswith('pypy'):
short_vers = vers[0:-2]
if vers.startswith('pypy3.'):
short_vers = vers[4:6]
else:
short_vers = vers[0:-2]
test_options[vers] = (os.path.join(lib_prefix, vers, 'lib_pypy'),
PYC, 'python-lib'+short_vers)
else:

View File

@@ -42,7 +42,7 @@ class Python34Parser(Python33Parser):
whileelsestmt ::= SETUP_LOOP testexpr l_stmts_opt JUMP_BACK POP_BLOCK
else_suitel COME_FROM
while1elsestmt ::= SETUP_LOOP l_stmts JUMP_BACK POP_BLOCK else_suitel
while1elsestmt ::= SETUP_LOOP l_stmts JUMP_BACK _come_froms POP_BLOCK else_suitel
COME_FROM_LOOP
# Python 3.4+ optimizes the trailing two JUMPS away