You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-04 01:09:52 +08:00
2.6 return_stmt bug
This commit is contained in:
BIN
test/bytecode_2.6/07_return_end_if.pyc
Normal file
BIN
test/bytecode_2.6/07_return_end_if.pyc
Normal file
Binary file not shown.
10
test/simple_source/looping/07_return_end_if.py
Normal file
10
test/simple_source/looping/07_return_end_if.py
Normal file
@@ -0,0 +1,10 @@
|
||||
# 2.6.9 asynchat.py
|
||||
# 2.6 added:
|
||||
# return_stmt ::= ret_expr RETURN_END_IF come_from_pop
|
||||
def initiate_send(self):
|
||||
while self:
|
||||
if self:
|
||||
x = 'a'
|
||||
else:
|
||||
del self.producer_fifo[0]
|
||||
return
|
@@ -299,6 +299,8 @@ class PythonParser(GenericASTBuilder):
|
||||
|
||||
while1stmt ::= SETUP_LOOP l_stmts JUMP_BACK COME_FROM
|
||||
while1stmt ::= SETUP_LOOP l_stmts JUMP_BACK POP_BLOCK COME_FROM
|
||||
|
||||
# This is Python 2.7+; segregate
|
||||
while1stmt ::= SETUP_LOOP return_stmts COME_FROM
|
||||
|
||||
while1elsestmt ::= SETUP_LOOP l_stmts JUMP_BACK else_suite COME_FROM
|
||||
|
@@ -123,11 +123,13 @@ class Python26Parser(Python2Parser):
|
||||
|
||||
whilestmt ::= SETUP_LOOP testexpr l_stmts_opt jb_cf_pop POP_BLOCK COME_FROM
|
||||
|
||||
while1stmt ::= SETUP_LOOP return_stmts POP_BLOCK COME_FROM
|
||||
|
||||
return_stmt ::= ret_expr RETURN_END_IF come_from_pop
|
||||
return_if_stmt ::= ret_expr RETURN_END_IF come_from_pop
|
||||
|
||||
iflaststmtl ::= testexpr c_stmts_opt JUMP_BACK come_from_pop
|
||||
iflaststmt ::= testexpr c_stmts_opt JUMP_ABSOLUTE come_from_pop
|
||||
|
||||
"""
|
||||
|
||||
def p_comp26(self, args):
|
||||
|
Reference in New Issue
Block a user