You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-03 00:45:53 +08:00
"or" rule regularization + regressions from xdis
This commit is contained in:
@@ -57,8 +57,8 @@ entry_points = {
|
|||||||
"pydisassemble=uncompyle6.bin.pydisassemble:main",
|
"pydisassemble=uncompyle6.bin.pydisassemble:main",
|
||||||
]}
|
]}
|
||||||
ftp_url = None
|
ftp_url = None
|
||||||
install_requires = ["spark-parser >= 1.8.9, < 1.9.0",
|
install_requires = ["spark-parser >= 1.8.9, < 1.9.0", ]
|
||||||
"xdis >= 4.3.2, < 4.4.0"]
|
# "xdis >= 4.3.2, < 4.4.0"]
|
||||||
|
|
||||||
license = "GPL3"
|
license = "GPL3"
|
||||||
mailing_list = "python-debugger@googlegroups.com"
|
mailing_list = "python-debugger@googlegroups.com"
|
||||||
|
1
setup.py
1
setup.py
@@ -39,5 +39,6 @@ setup(
|
|||||||
test_suite = 'nose.collector',
|
test_suite = 'nose.collector',
|
||||||
url = web,
|
url = web,
|
||||||
tests_require = ['nose>=1.0'],
|
tests_require = ['nose>=1.0'],
|
||||||
|
dependency_links =['http://github.com/rocky/python-xdis/tarball/master#egg=xdis-4.3.3'],
|
||||||
version = VERSION,
|
version = VERSION,
|
||||||
zip_safe = zip_safe)
|
zip_safe = zip_safe)
|
||||||
|
@@ -95,12 +95,19 @@ check-bytecode-2:
|
|||||||
--bytecode-2.5 --bytecode-2.6 --bytecode-2.7 --bytecode-pypy2.7
|
--bytecode-2.5 --bytecode-2.6 --bytecode-2.7 --bytecode-pypy2.7
|
||||||
|
|
||||||
#: Check deparsing bytecode 3.x only
|
#: Check deparsing bytecode 3.x only
|
||||||
|
# check-bytecode-3:
|
||||||
|
# $(PYTHON) test_pythonlib.py \
|
||||||
|
# --bytecode-3.0 \
|
||||||
|
# --bytecode-3.1 --bytecode-3.2 --bytecode-3.3 \
|
||||||
|
# --bytecode-3.4 --bytecode-3.5 --bytecode-3.6 \
|
||||||
|
# --bytecode-3.7 \
|
||||||
|
# --bytecode-pypy3.2 --bytecode-pypy3.6 --bytecode-3.8
|
||||||
|
|
||||||
|
# FIXME: Until we shaked out problems with xdis...
|
||||||
check-bytecode-3:
|
check-bytecode-3:
|
||||||
$(PYTHON) test_pythonlib.py --bytecode-3.0 \
|
$(PYTHON) test_pythonlib.py \
|
||||||
--bytecode-3.1 --bytecode-3.2 --bytecode-3.3 \
|
|
||||||
--bytecode-3.4 --bytecode-3.5 --bytecode-3.6 \
|
--bytecode-3.4 --bytecode-3.5 --bytecode-3.6 \
|
||||||
--bytecode-3.7 \
|
--bytecode-3.7 --bytecode-3.8
|
||||||
--bytecode-pypy3.2 --bytecode-pypy3.6 --bytecode-3.8
|
|
||||||
|
|
||||||
#: Check deparsing on selected bytecode 3.x
|
#: Check deparsing on selected bytecode 3.x
|
||||||
check-bytecode-3-short:
|
check-bytecode-3-short:
|
||||||
|
@@ -196,8 +196,9 @@ class Python2Parser(PythonParser):
|
|||||||
expr ::= slice3
|
expr ::= slice3
|
||||||
expr ::= unary_convert
|
expr ::= unary_convert
|
||||||
|
|
||||||
and ::= expr jmp_false expr come_from_opt
|
expr_jt ::= expr jmp_true
|
||||||
or ::= expr jmp_true expr come_from_opt
|
or ::= expr_jt expr come_from_opt
|
||||||
|
and ::= expr jmp_false expr come_from_opt
|
||||||
|
|
||||||
unary_convert ::= expr UNARY_CONVERT
|
unary_convert ::= expr UNARY_CONVERT
|
||||||
|
|
||||||
|
@@ -278,10 +278,16 @@ class Python3Parser(PythonParser):
|
|||||||
POP_BLOCK LOAD_CONST COME_FROM_WITH
|
POP_BLOCK LOAD_CONST COME_FROM_WITH
|
||||||
WITH_CLEANUP END_FINALLY
|
WITH_CLEANUP END_FINALLY
|
||||||
|
|
||||||
|
expr_jt ::= expr jmp_true
|
||||||
|
expr_jitop ::= expr JUMP_IF_TRUE_OR_POP
|
||||||
|
|
||||||
## FIXME: Right now we have erroneous jump targets
|
## FIXME: Right now we have erroneous jump targets
|
||||||
## This below is probably not correct when the COME_FROM is put in the right place
|
## This below is probably not correct when the COME_FROM is put in the right place
|
||||||
and ::= expr jmp_false expr COME_FROM
|
and ::= expr jmp_false expr COME_FROM
|
||||||
or ::= expr jmp_true expr COME_FROM
|
or ::= expr_jt expr COME_FROM
|
||||||
|
or ::= expr_jt expr
|
||||||
|
or ::= expr_jitop expr COME_FROM
|
||||||
|
and ::= expr JUMP_IF_FALSE_OR_POP expr COME_FROM
|
||||||
|
|
||||||
# # something like the below is needed when the jump targets are fixed
|
# # something like the below is needed when the jump targets are fixed
|
||||||
## or ::= expr JUMP_IF_TRUE_OR_POP COME_FROM expr
|
## or ::= expr JUMP_IF_TRUE_OR_POP COME_FROM expr
|
||||||
@@ -339,9 +345,6 @@ class Python3Parser(PythonParser):
|
|||||||
ret_or ::= expr JUMP_IF_TRUE_OR_POP ret_expr_or_cond COME_FROM
|
ret_or ::= expr JUMP_IF_TRUE_OR_POP ret_expr_or_cond COME_FROM
|
||||||
if_exp_ret ::= expr POP_JUMP_IF_FALSE expr RETURN_END_IF COME_FROM ret_expr_or_cond
|
if_exp_ret ::= expr POP_JUMP_IF_FALSE expr RETURN_END_IF COME_FROM ret_expr_or_cond
|
||||||
|
|
||||||
or ::= expr JUMP_IF_TRUE_OR_POP expr COME_FROM
|
|
||||||
or ::= expr jmp_true expr
|
|
||||||
and ::= expr JUMP_IF_FALSE_OR_POP expr COME_FROM
|
|
||||||
|
|
||||||
# compare_chained1 is used exclusively in chained_compare
|
# compare_chained1 is used exclusively in chained_compare
|
||||||
compare_chained1 ::= expr DUP_TOP ROT_THREE COMPARE_OP JUMP_IF_FALSE_OR_POP
|
compare_chained1 ::= expr DUP_TOP ROT_THREE COMPARE_OP JUMP_IF_FALSE_OR_POP
|
||||||
|
@@ -134,8 +134,9 @@ class Python30Parser(Python31Parser):
|
|||||||
|
|
||||||
jump_except ::= _jump COME_FROM POP_TOP
|
jump_except ::= _jump COME_FROM POP_TOP
|
||||||
|
|
||||||
|
expr_jt ::= expr jmp_true
|
||||||
or ::= expr jmp_false expr jmp_true expr
|
or ::= expr jmp_false expr jmp_true expr
|
||||||
or ::= expr jmp_true expr
|
or ::= expr_jt expr
|
||||||
|
|
||||||
import_from ::= LOAD_CONST LOAD_CONST IMPORT_NAME importlist _come_froms POP_TOP
|
import_from ::= LOAD_CONST LOAD_CONST IMPORT_NAME importlist _come_froms POP_TOP
|
||||||
|
|
||||||
|
@@ -638,7 +638,6 @@ class Python37Parser(Python37BaseParser):
|
|||||||
expr_pjit ::= expr POP_JUMP_IF_TRUE
|
expr_pjit ::= expr POP_JUMP_IF_TRUE
|
||||||
expr_jit ::= expr JUMP_IF_TRUE
|
expr_jit ::= expr JUMP_IF_TRUE
|
||||||
expr_jt ::= expr jmp_true
|
expr_jt ::= expr jmp_true
|
||||||
expr_jitop ::= expr JUMP_IF_TRUE_OR_POP
|
|
||||||
|
|
||||||
jmp_false37 ::= POP_JUMP_IF_FALSE COME_FROM
|
jmp_false37 ::= POP_JUMP_IF_FALSE COME_FROM
|
||||||
list_if ::= expr jmp_false37 list_iter
|
list_if ::= expr jmp_false37 list_iter
|
||||||
@@ -960,7 +959,7 @@ class Python37Parser(Python37BaseParser):
|
|||||||
|
|
||||||
## Note that "jmp_false" is what we check on in the "and" reduce rule.
|
## Note that "jmp_false" is what we check on in the "and" reduce rule.
|
||||||
and ::= expr jmp_false expr COME_FROM
|
and ::= expr jmp_false expr COME_FROM
|
||||||
or ::= expr jmp_true expr COME_FROM
|
or ::= expr_jt expr COME_FROM
|
||||||
|
|
||||||
# compare_chained1 is used exclusively in chained_compare
|
# compare_chained1 is used exclusively in chained_compare
|
||||||
compare_chained1 ::= expr DUP_TOP ROT_THREE COMPARE_OP JUMP_IF_FALSE_OR_POP
|
compare_chained1 ::= expr DUP_TOP ROT_THREE COMPARE_OP JUMP_IF_FALSE_OR_POP
|
||||||
|
Reference in New Issue
Block a user