You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-04 01:09:52 +08:00
Add more come_from_pops
This commit is contained in:
BIN
test/bytecode_2.6/06_return_if.pyc
Normal file
BIN
test/bytecode_2.6/06_return_if.pyc
Normal file
Binary file not shown.
11
test/simple_source/stmts/06_return_if.py
Normal file
11
test/simple_source/stmts/06_return_if.py
Normal file
@@ -0,0 +1,11 @@
|
||||
# from 2.6.9 Bastion.py
|
||||
# Should see in 2.6.9:
|
||||
# return_if_stmt ::= ret_expr RETURN_END_IF come_from_pop
|
||||
|
||||
def Bastion(object, filter = lambda name: name[:1] != '_'):
|
||||
def get1(name, attribute, MethodType, object=object, filter=filter):
|
||||
if filter(name):
|
||||
attribute = getattr(object, name)
|
||||
if type(attribute) == MethodType:
|
||||
return attribute
|
||||
raise AttributeError, name
|
@@ -57,15 +57,6 @@ class Python26Parser(Python2Parser):
|
||||
|
||||
"""
|
||||
|
||||
def p_whilestmt(self, args):
|
||||
"""
|
||||
whilestmt ::= SETUP_LOOP
|
||||
testexpr
|
||||
l_stmts_opt jb_pop
|
||||
POP_BLOCK _come_from
|
||||
|
||||
"""
|
||||
|
||||
def p_misc26(self, args):
|
||||
"""
|
||||
jmp_true ::= JUMP_IF_TRUE POP_TOP
|
||||
@@ -94,6 +85,14 @@ class Python26Parser(Python2Parser):
|
||||
# This is truly weird. 2.7 does this (not including POP_TOP) with
|
||||
# opcode SETUP_WITH
|
||||
setupwith ::= DUP_TOP LOAD_ATTR ROT_TWO LOAD_ATTR CALL_FUNCTION_0 POP_TOP
|
||||
|
||||
whilestmt ::= SETUP_LOOP
|
||||
testexpr
|
||||
l_stmts_opt jb_pop
|
||||
POP_BLOCK _come_from
|
||||
|
||||
return_if_stmt ::= ret_expr RETURN_END_IF come_from_pop
|
||||
|
||||
"""
|
||||
|
||||
def p_comp26(self, args):
|
||||
|
Reference in New Issue
Block a user