You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-04 01:09:52 +08:00
More PyPy LOOKUP_METHOD rules
This commit is contained in:
2
Makefile
2
Makefile
@@ -42,7 +42,7 @@ check-2.6:
|
|||||||
|
|
||||||
#:PyPy of some sort. E.g. [PyPy 5.0.1 with GCC 4.8.4]
|
#:PyPy of some sort. E.g. [PyPy 5.0.1 with GCC 4.8.4]
|
||||||
# Skip for now
|
# Skip for now
|
||||||
2.6 5.0:
|
2.4 2.6 5.0:
|
||||||
|
|
||||||
#: Run py.test tests
|
#: Run py.test tests
|
||||||
pytest:
|
pytest:
|
||||||
|
@@ -112,7 +112,7 @@ check-3.4-ok:
|
|||||||
|
|
||||||
#:PyPy of some sort. E.g. [PyPy 5.0.1 with GCC 4.8.4]
|
#:PyPy of some sort. E.g. [PyPy 5.0.1 with GCC 4.8.4]
|
||||||
# Skip for now
|
# Skip for now
|
||||||
2.6 5.0:
|
2.4 2.6 5.0:
|
||||||
|
|
||||||
clean: clean-py-dis clean-dis clean-unverified
|
clean: clean-py-dis clean-dis clean-unverified
|
||||||
|
|
||||||
|
Binary file not shown.
@@ -270,6 +270,8 @@ class Python2Parser(PythonParser):
|
|||||||
# A PyPy speciality
|
# A PyPy speciality
|
||||||
self.add_unique_rule("load_attr ::= LOAD_FAST LOOKUP_METHOD",
|
self.add_unique_rule("load_attr ::= LOAD_FAST LOOKUP_METHOD",
|
||||||
op, v, customize)
|
op, v, customize)
|
||||||
|
self.add_unique_rule("load_attr ::= LOAD_NAME LOOKUP_METHOD",
|
||||||
|
op, v, customize)
|
||||||
self.add_unique_rule("call_function ::= expr CALL_METHOD",
|
self.add_unique_rule("call_function ::= expr CALL_METHOD",
|
||||||
op, v, customize)
|
op, v, customize)
|
||||||
continue
|
continue
|
||||||
|
@@ -470,6 +470,8 @@ class Python3Parser(PythonParser):
|
|||||||
# A PyPy speciality
|
# A PyPy speciality
|
||||||
self.add_unique_rule("load_attr ::= LOAD_FAST LOOKUP_METHOD",
|
self.add_unique_rule("load_attr ::= LOAD_FAST LOOKUP_METHOD",
|
||||||
opname, token.attr, customize)
|
opname, token.attr, customize)
|
||||||
|
self.add_unique_rule("load_attr ::= LOAD_NAME LOOKUP_METHOD",
|
||||||
|
opname, token.attr, customize)
|
||||||
self.add_unique_rule("call_function ::= expr CALL_METHOD",
|
self.add_unique_rule("call_function ::= expr CALL_METHOD",
|
||||||
opname, token.attr, customize)
|
opname, token.attr, customize)
|
||||||
continue
|
continue
|
||||||
|
@@ -128,6 +128,7 @@ class Scanner3(scan.Scanner):
|
|||||||
for instr in bytecode.get_instructions(co):
|
for instr in bytecode.get_instructions(co):
|
||||||
print(instr._disassemble())
|
print(instr._disassemble())
|
||||||
|
|
||||||
|
customize = {}
|
||||||
# Container for tokens
|
# Container for tokens
|
||||||
tokens = []
|
tokens = []
|
||||||
|
|
||||||
@@ -235,6 +236,8 @@ class Scanner3(scan.Scanner):
|
|||||||
elif op in self.varargs:
|
elif op in self.varargs:
|
||||||
pos_args = inst.argval
|
pos_args = inst.argval
|
||||||
opname = '%s_%d' % (opname, pos_args)
|
opname = '%s_%d' % (opname, pos_args)
|
||||||
|
elif self.is_pypy and opname == 'CALL_METHOD':
|
||||||
|
customize['CALL_METHOD'] = argval
|
||||||
elif opname == 'UNPACK_EX':
|
elif opname == 'UNPACK_EX':
|
||||||
# FIXME: try with scanner and parser by
|
# FIXME: try with scanner and parser by
|
||||||
# changing inst.argval
|
# changing inst.argval
|
||||||
@@ -296,7 +299,7 @@ class Scanner3(scan.Scanner):
|
|||||||
for t in tokens:
|
for t in tokens:
|
||||||
print(t.format())
|
print(t.format())
|
||||||
print()
|
print()
|
||||||
return tokens, {}
|
return tokens, customize
|
||||||
|
|
||||||
def build_lines_data(self, code_obj):
|
def build_lines_data(self, code_obj):
|
||||||
"""
|
"""
|
||||||
|
Reference in New Issue
Block a user