You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-02 16:44:46 +08:00
3.4 if/while bug
This commit is contained in:
BIN
test/bytecode_3.4/12_if_while_bug.pyc
Normal file
BIN
test/bytecode_3.4/12_if_while_bug.pyc
Normal file
Binary file not shown.
17
test/simple_source/looping/12_if_while_bug.py
Normal file
17
test/simple_source/looping/12_if_while_bug.py
Normal file
@@ -0,0 +1,17 @@
|
||||
# From genericpath
|
||||
# Problem on Python 3.4
|
||||
# end of if can come from both finishing loop
|
||||
# and not taking the if.
|
||||
|
||||
# whilestmt ::= SETUP_LOOP testexpr l_stmts_opt JUMP_BACK POP_BLOCK \e__come_from
|
||||
# _ifstmts_jump ::= c_stmts_opt JUMP_FORWARD \e__come_from
|
||||
# ifstmt ::= testexpr _ifstmts_jump
|
||||
# _come_from ::= _come_from COME_FROM
|
||||
# _ifstmts_jump ::= c_stmts_opt JUMP_FORWARD _come_from
|
||||
|
||||
def splitext(p, sep, altsep, extsep):
|
||||
if altsep > extsep:
|
||||
while sep < altsep:
|
||||
sep += 1
|
||||
|
||||
return p
|
@@ -243,7 +243,7 @@ class Python3Parser(PythonParser):
|
||||
testtrue ::= expr jmp_true
|
||||
|
||||
_ifstmts_jump ::= return_if_stmts
|
||||
_ifstmts_jump ::= c_stmts_opt JUMP_FORWARD COME_FROM
|
||||
_ifstmts_jump ::= c_stmts_opt JUMP_FORWARD _come_from
|
||||
_ifstmts_jump ::= c_stmts_opt
|
||||
|
||||
iflaststmt ::= testexpr c_stmts_opt JUMP_ABSOLUTE
|
||||
|
Reference in New Issue
Block a user