Small changes....

* __pkginfo__.py: Need spark parser 1.6.1 for corrected remove_rules() fn
* parser36.py: remove replaced Python3 rules
* scanner3.py: corrected comment. Thanks to moagstar here.
*
This commit is contained in:
rocky
2017-05-17 23:31:56 -04:00
parent 52b1f4d2b6
commit 6991a637a2
3 changed files with 25 additions and 2 deletions

View File

@@ -39,7 +39,7 @@ entry_points={
'pydisassemble=uncompyle6.bin.pydisassemble:main',
]}
ftp_url = None
install_requires = ['spark-parser >= 1.6.0, < 1.7.0',
install_requires = ['spark-parser >= 1.6.1, < 1.7.0',
'xdis >= 3.3.0, < 3.4.0']
license = 'MIT'
mailing_list = 'python-debugger@googlegroups.com'

View File

@@ -84,6 +84,29 @@ class Python36Parser(Python35Parser):
def add_custom_rules(self, tokens, customize):
super(Python36Parser, self).add_custom_rules(tokens, customize)
self.remove_rule("""
forstmt ::= SETUP_LOOP expr _for designator for_block POP_BLOCK
opt_come_from_loop
forelsestmt ::= SETUP_LOOP expr _for designator for_block POP_BLOCK else_suite
COME_FROM_LOOP
forelselaststmt ::= SETUP_LOOP expr _for designator for_block POP_BLOCK else_suitec
COME_FROM_LOOP
forelselaststmtl ::= SETUP_LOOP expr _for designator for_block POP_BLOCK else_suitel
COME_FROM_LOOP
whilestmt ::= SETUP_LOOP testexpr l_stmts_opt COME_FROM jump_back POP_BLOCK
COME_FROM_LOOP
whilestmt ::= SETUP_LOOP testexpr l_stmts_opt jump_back POP_BLOCK
COME_FROM_LOOP
whileTruestmt ::= SETUP_LOOP l_stmts_opt JUMP_BACK POP_BLOCK COME_FROM_LOOP
COME_FROM_LOOP
""")
for i, token in enumerate(tokens):
opname = token.type

View File

@@ -275,7 +275,7 @@ class Scanner3(Scanner):
pass
elif opname in ('MAKE_FUNCTION', 'MAKE_CLOSURE'):
if self.version >= 3.6:
# 3.6+ doesn't have MAKE_CLOSURE, so opname == 'MAKE_CLOSURE'
# 3.6+ doesn't have MAKE_CLOSURE, so opname == 'MAKE_FUNCTION'
flags = inst.argval
opname = 'MAKE_FUNCTION_%d' % (flags)
attr = []