You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-02 16:44:46 +08:00
Handle Ternary "or". Remove mention of uncompyle3
uncompyle3 removed per Mysterie's request [Fixes Issue #5]
This commit is contained in:
@@ -90,10 +90,6 @@ Hartmut a decade an a half ago:
|
||||
NB. This is not a masterpiece of software, but became more like a hack.
|
||||
Probably a complete rewrite would be sensefull. hG/2000-12-27
|
||||
|
||||
One of the attempts to modernize it and make it available for Python3
|
||||
is [the one by Anton Vorobyov (DarkFenX)](https://github.com/DarkFenX/uncompyle3). I've
|
||||
followed some of the ideas there in this project.
|
||||
|
||||
Lastly, I should mention [unpyc](https://code.google.com/p/unpyc3/)
|
||||
and most especially [pycdc](https://github.com/zrax/pycdc), largely by
|
||||
Michael Hansen and Darryl Pogue. If they supported getting source-code
|
||||
|
@@ -93,7 +93,6 @@ See Also
|
||||
|
||||
* https://github.com/zrax/pycdc
|
||||
* https://github.com/Mysterie/uncompyle2
|
||||
* https://github.com/DarkFenX/uncompyle3
|
||||
* https://code.google.com/p/unpyc3/
|
||||
|
||||
The HISTORY file.
|
||||
|
BIN
test/bytecode_2.5/10_if_else_ternary.pyc
Normal file
BIN
test/bytecode_2.5/10_if_else_ternary.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_2.6/10_if_else_ternary.pyc
Normal file
BIN
test/bytecode_2.6/10_if_else_ternary.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_2.7/10_if_else_ternary.pyc
Normal file
BIN
test/bytecode_2.7/10_if_else_ternary.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_3.5/10_if_else_ternary.pyc_notyet
Normal file
BIN
test/bytecode_3.5/10_if_else_ternary.pyc_notyet
Normal file
Binary file not shown.
11
test/simple_source/branching/10_if_else_ternary.py
Normal file
11
test/simple_source/branching/10_if_else_ternary.py
Normal file
@@ -0,0 +1,11 @@
|
||||
# Tests:
|
||||
|
||||
# ret_expr_or_cond ::= ret_expr
|
||||
# ret_cond ::= expr POP_JUMP_IF_FALSE expr RETURN_END_IF ret_expr_or_cond
|
||||
# ret_expr_or_cond ::= ret_cond
|
||||
# ret_or ::= expr JUMP_IF_TRUE_OR_POP ret_expr_or_cond COME_FROM
|
||||
|
||||
# See https://github.com/rocky/python-uncompyle6/issues/5
|
||||
|
||||
def minimize(x, y):
|
||||
return x or (x if x < y else y)
|
@@ -581,8 +581,8 @@ class Python2Parser(PythonParser):
|
||||
_mklambda ::= load_closure mklambda
|
||||
_mklambda ::= mklambda
|
||||
|
||||
or ::= expr jmp_true expr _come_from
|
||||
or ::= expr JUMP_IF_TRUE_OR_POP expr COME_FROM
|
||||
or ::= expr jmp_true expr _come_from
|
||||
and ::= expr jmp_false expr _come_from
|
||||
and ::= expr JUMP_IF_FALSE_OR_POP expr COME_FROM
|
||||
and2 ::= _jump jmp_false COME_FROM expr COME_FROM
|
||||
@@ -601,10 +601,10 @@ class Python2Parser(PythonParser):
|
||||
ret_expr_or_cond ::= ret_cond
|
||||
ret_expr_or_cond ::= ret_cond_not
|
||||
|
||||
ret_and ::= expr jmp_false ret_expr_or_cond COME_FROM
|
||||
ret_or ::= expr jmp_true ret_expr_or_cond COME_FROM
|
||||
ret_cond ::= expr jmp_false expr RETURN_END_IF ret_expr_or_cond
|
||||
ret_cond_not ::= expr jmp_true expr RETURN_END_IF ret_expr_or_cond
|
||||
ret_and ::= expr JUMP_IF_FALSE_OR_POP ret_expr_or_cond COME_FROM
|
||||
ret_or ::= expr JUMP_IF_TRUE_OR_POP ret_expr_or_cond COME_FROM
|
||||
ret_cond ::= expr POP_JUMP_IF_FALSE expr RETURN_END_IF ret_expr_or_cond
|
||||
ret_cond_not ::= expr POP_JUMP_IF_TRUE expr RETURN_END_IF ret_expr_or_cond
|
||||
|
||||
stmt ::= return_lambda
|
||||
stmt ::= conditional_lambda
|
||||
|
@@ -631,10 +631,10 @@ class Python3Parser(PythonParser):
|
||||
ret_expr_or_cond ::= ret_cond
|
||||
ret_expr_or_cond ::= ret_cond_not
|
||||
|
||||
ret_and ::= expr jmp_false ret_expr_or_cond COME_FROM
|
||||
ret_or ::= expr jmp_true ret_expr_or_cond COME_FROM
|
||||
ret_cond ::= expr jmp_false expr RETURN_END_IF ret_expr_or_cond
|
||||
ret_cond_not ::= expr jmp_true expr RETURN_END_IF ret_expr_or_cond
|
||||
ret_and ::= expr JUMP_IF_FALSE_OR_POP ret_expr_or_cond COME_FROM
|
||||
ret_or ::= expr JUMP_IF_TRUE_OR_POP ret_expr_or_cond COME_FROM
|
||||
ret_cond ::= expr POP_JUMP_IF_FALSE expr RETURN_END_IF ret_expr_or_cond
|
||||
ret_cond_not ::= expr POP_JUMP_IF_TRUE expr RETURN_END_IF ret_expr_or_cond
|
||||
|
||||
stmt ::= return_lambda
|
||||
stmt ::= conditional_lambda
|
||||
|
Reference in New Issue
Block a user