while1 bug applied to Python 2.3 and 2.4

This commit is contained in:
rocky
2016-07-28 01:23:29 -04:00
parent 5c9c0228ee
commit 152935ab26
4 changed files with 6 additions and 2 deletions

View File

@@ -43,6 +43,7 @@ class Python2Parser(PythonParser):
def p_stmt2(self, args): def p_stmt2(self, args):
""" """
while1stmt ::= SETUP_LOOP l_stmts_opt JUMP_BACK POP_BLOCK COME_FROM while1stmt ::= SETUP_LOOP l_stmts_opt JUMP_BACK POP_BLOCK COME_FROM
exec_stmt ::= expr exprlist DUP_TOP EXEC_STMT exec_stmt ::= expr exprlist DUP_TOP EXEC_STMT
exec_stmt ::= expr exprlist EXEC_STMT exec_stmt ::= expr exprlist EXEC_STMT

View File

@@ -14,9 +14,11 @@ class Python23Parser(Python24Parser):
def p_misc23(self, args): def p_misc23(self, args):
''' '''
_while1test ::= JUMP_FORWARD JUMP_IF_FALSE POP_TOP COME_FROM # Used to keep semantic positions the same across later versions
# of Python
_while1test ::= SETUP_LOOP JUMP_FORWARD JUMP_IF_FALSE POP_TOP COME_FROM
while1stmt ::= SETUP_LOOP _while1test l_stmts JUMP_BACK while1stmt ::= _while1test l_stmts_opt JUMP_BACK
COME_FROM POP_TOP POP_BLOCK COME_FROM COME_FROM POP_TOP POP_BLOCK COME_FROM
list_compr ::= BUILD_LIST_0 DUP_TOP LOAD_ATTR designator list_iter del_stmt list_compr ::= BUILD_LIST_0 DUP_TOP LOAD_ATTR designator list_iter del_stmt

View File

@@ -26,6 +26,7 @@ class Python24Parser(Python25Parser):
# Python 2.5+ omits POP_TOP POP_BLOCK # Python 2.5+ omits POP_TOP POP_BLOCK
while1stmt ::= SETUP_LOOP l_stmts JUMP_BACK POP_TOP POP_BLOCK COME_FROM while1stmt ::= SETUP_LOOP l_stmts JUMP_BACK POP_TOP POP_BLOCK COME_FROM
while1stmt ::= SETUP_LOOP l_stmts_opt JUMP_BACK POP_TOP POP_BLOCK COME_FROM
# Python 2.5+: # Python 2.5+:
# call_stmt ::= expr POP_TOP # call_stmt ::= expr POP_TOP