You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-02 16:44:46 +08:00
Python 3: "and" doesn't have optional come_from
This commit is contained in:
@@ -454,7 +454,6 @@ class PythonParser(GenericASTBuilder):
|
||||
_mklambda ::= mklambda
|
||||
|
||||
or ::= expr jmp_true expr come_from_opt
|
||||
and ::= expr jmp_false expr come_from_opt
|
||||
and2 ::= _jump jmp_false COME_FROM expr COME_FROM
|
||||
|
||||
expr ::= conditional
|
||||
|
@@ -215,6 +215,8 @@ class Python2Parser(PythonParser):
|
||||
expr ::= slice3
|
||||
expr ::= unary_convert
|
||||
|
||||
and ::= expr jmp_false expr come_from_opt
|
||||
|
||||
slice0 ::= expr SLICE+0
|
||||
slice0 ::= expr DUP_TOP SLICE+0
|
||||
slice1 ::= expr expr SLICE+1
|
||||
|
@@ -231,6 +231,7 @@ class Python3Parser(PythonParser):
|
||||
POP_BLOCK LOAD_CONST COME_FROM_WITH
|
||||
WITH_CLEANUP END_FINALLY
|
||||
|
||||
and ::= expr jmp_false expr COME_FROM
|
||||
'''
|
||||
|
||||
def p_misc3(self, args):
|
||||
|
@@ -745,7 +745,8 @@ class Scanner3(Scanner):
|
||||
code[prev_op[prev_op[rtarget]]] != self.opc.JUMP_ABSOLUTE)):
|
||||
rtarget = prev_op[rtarget]
|
||||
|
||||
# Does the "if" jump just beyond a jump op, then this is probably an if statement
|
||||
# Does the "if" jump just beyond a jump op, then this can be
|
||||
# a block inside an "if" statement
|
||||
if self.is_jump_forward(prev_op[rtarget]):
|
||||
if_end = self.get_target(prev_op[rtarget])
|
||||
|
||||
|
Reference in New Issue
Block a user