コード例 #1
0
ファイル: decompiling.py プロジェクト: thedrow/pony
 def BINARY_SUBSCR(decompiler):
     oper2 = decompiler.stack.pop()
     oper1 = decompiler.stack.pop()
     if isinstance(oper2, ast.Tuple):
         return ast.Subscript(oper1, 'OP_APPLY', list(oper2.nodes))
     else:
         return ast.Subscript(oper1, 'OP_APPLY', [oper2])
コード例 #2
0
 def BINARY_SUBSCR(decompiler):
     oper2 = decompiler.stack.pop()
     oper1 = decompiler.stack.pop()
     if isinstance(oper2, ast.Sliceobj) and len(oper2.nodes) == 2:
         a, b = oper2.nodes
         a = None if isinstance(a, ast.Const) and a.value == None else a
         b = None if isinstance(b, ast.Const) and b.value == None else b
         return ast.Slice(oper1, 'OP_APPLY', a, b)
     elif isinstance(oper2, ast.Tuple):
         return ast.Subscript(oper1, 'OP_APPLY', list(oper2.nodes))
     else:
         return ast.Subscript(oper1, 'OP_APPLY', [ oper2 ])