You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-04 01:09:52 +08:00
Fix some 3.6/3.7 bugs
This commit is contained in:
Binary file not shown.
BIN
test/bytecode_3.7/02_ifelse_lambda.pyc
Normal file
BIN
test/bytecode_3.7/02_ifelse_lambda.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_3.7/02_kwargs.pyc
Normal file
BIN
test/bytecode_3.7/02_kwargs.pyc
Normal file
Binary file not shown.
@@ -16,6 +16,9 @@ class Python35Parser(Python34Parser):
|
|||||||
|
|
||||||
def p_35on(self, args):
|
def p_35on(self, args):
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
pb_ja ::= POP_BLOCK JUMP_ABSOLUTE
|
||||||
|
|
||||||
# The number of canned instructions in new statements is mind boggling.
|
# The number of canned instructions in new statements is mind boggling.
|
||||||
# I'm sure by the time Python 4 comes around these will be turned
|
# I'm sure by the time Python 4 comes around these will be turned
|
||||||
# into special opcodes
|
# into special opcodes
|
||||||
@@ -90,7 +93,7 @@ class Python35Parser(Python34Parser):
|
|||||||
LOAD_GLOBAL COMPARE_OP POP_JUMP_IF_FALSE
|
LOAD_GLOBAL COMPARE_OP POP_JUMP_IF_FALSE
|
||||||
POP_TOP POP_TOP POP_TOP POP_EXCEPT POP_BLOCK
|
POP_TOP POP_TOP POP_TOP POP_EXCEPT POP_BLOCK
|
||||||
JUMP_ABSOLUTE END_FINALLY COME_FROM
|
JUMP_ABSOLUTE END_FINALLY COME_FROM
|
||||||
for_block POP_BLOCK JUMP_ABSOLUTE
|
for_block pb_ja
|
||||||
else_suite COME_FROM_LOOP
|
else_suite COME_FROM_LOOP
|
||||||
|
|
||||||
|
|
||||||
|
@@ -56,6 +56,19 @@ class Python36Parser(Python35Parser):
|
|||||||
jf_cf ::= JUMP_FORWARD COME_FROM
|
jf_cf ::= JUMP_FORWARD COME_FROM
|
||||||
conditional ::= expr jmp_false expr jf_cf expr COME_FROM
|
conditional ::= expr jmp_false expr jf_cf expr COME_FROM
|
||||||
|
|
||||||
|
# FIXME: remove corresponding rule for 3.5
|
||||||
|
async_forelse_stmt ::= SETUP_LOOP expr
|
||||||
|
GET_AITER
|
||||||
|
LOAD_CONST YIELD_FROM SETUP_EXCEPT GET_ANEXT LOAD_CONST
|
||||||
|
YIELD_FROM
|
||||||
|
store
|
||||||
|
POP_BLOCK JUMP_FORWARD COME_FROM_EXCEPT DUP_TOP
|
||||||
|
LOAD_GLOBAL COMPARE_OP POP_JUMP_IF_FALSE
|
||||||
|
POP_TOP POP_TOP POP_TOP POP_EXCEPT POP_BLOCK
|
||||||
|
JUMP_ABSOLUTE END_FINALLY COME_FROM
|
||||||
|
for_block POP_BLOCK
|
||||||
|
else_suite COME_FROM_LOOP
|
||||||
|
|
||||||
# Adds a COME_FROM_ASYNC_WITH over 3.5
|
# Adds a COME_FROM_ASYNC_WITH over 3.5
|
||||||
# FIXME: remove corresponding rule for 3.5?
|
# FIXME: remove corresponding rule for 3.5?
|
||||||
|
|
||||||
|
@@ -265,7 +265,8 @@ def customize_for_version3(self, version):
|
|||||||
'async_for_stmt': (
|
'async_for_stmt': (
|
||||||
'%|async for %c in %c:\n%+%c%-\n\n', 9, 1, 25 ),
|
'%|async for %c in %c:\n%+%c%-\n\n', 9, 1, 25 ),
|
||||||
'async_forelse_stmt': (
|
'async_forelse_stmt': (
|
||||||
'%|async for %c in %c:\n%+%c%-%|else:\n%+%c%-\n\n', 9, 1, 25, 28 ),
|
'%|async for %c in %c:\n%+%c%-%|else:\n%+%c%-\n\n',
|
||||||
|
9, 1, 25, (27, 'else_suite') ),
|
||||||
'async_with_stmt': (
|
'async_with_stmt': (
|
||||||
'%|async with %c:\n%+%c%-', 0, 7),
|
'%|async with %c:\n%+%c%-', 0, 7),
|
||||||
'async_with_as_stmt': (
|
'async_with_as_stmt': (
|
||||||
|
Reference in New Issue
Block a user