You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-03 00:45:53 +08:00
Regularize "or" so args are in 1..2 and ...
correct "return None" semantic action
This commit is contained in:
2
test/.gitignore
vendored
2
test/.gitignore
vendored
@@ -2,5 +2,7 @@
|
|||||||
/.python-version
|
/.python-version
|
||||||
/nohup.out
|
/nohup.out
|
||||||
/pycdc
|
/pycdc
|
||||||
|
/test_pycdc_tests.sh
|
||||||
|
/test_uncompyle2.py
|
||||||
/test_unpy33.py
|
/test_unpy33.py
|
||||||
/test_unpy37.py
|
/test_unpy37.py
|
||||||
|
@@ -956,8 +956,8 @@ class Python37Parser(Python37BaseParser):
|
|||||||
and ::= expr JUMP_IF_FALSE_OR_POP expr come_from_opt
|
and ::= expr JUMP_IF_FALSE_OR_POP expr come_from_opt
|
||||||
and ::= expr jifop_come_from expr
|
and ::= expr jifop_come_from expr
|
||||||
|
|
||||||
pjit_come_from ::= POP_JUMP_IF_TRUE COME_FROM
|
expr_pjit_come_from ::= expr POP_JUMP_IF_TRUE COME_FROM
|
||||||
or ::= expr pjit_come_from expr
|
or ::= expr_pjit_come_from expr
|
||||||
|
|
||||||
## 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
|
||||||
|
@@ -516,7 +516,7 @@ class SourceWalker(GenericASTTraversal, object):
|
|||||||
if self.return_none or not self.is_return_none(node):
|
if self.return_none or not self.is_return_none(node):
|
||||||
self.default(node)
|
self.default(node)
|
||||||
else:
|
else:
|
||||||
self.template_engine(("return\n"), node)
|
self.template_engine(("%|return\n",), node)
|
||||||
|
|
||||||
self.prune() # stop recursing
|
self.prune() # stop recursing
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user