Start to handle 3.7

This commit is contained in:
rocky
2018-04-12 23:49:37 -04:00
parent fa6408d53b
commit 7237658f1f
4 changed files with 17 additions and 3 deletions

Binary file not shown.

View File

@@ -71,10 +71,9 @@ def main_bin():
if not (sys.version_info[0:2] in ((2, 6), (2, 7),
(3, 1), (3, 2), (3, 3),
(3, 4), (3, 5), (3, 6),
# (3, 7)
(3, 7)
)):
# print('Error: %s requires Python 2.6-2.7, or 3.1-3.7' % program,
print('Error: %s requires Python 2.6-2.7, or 3.1-3.6' % program,
print('Error: %s requires Python 2.6-2.7, or 3.1-3.7' % program,
file=sys.stderr)
sys.exit(-1)

View File

@@ -721,6 +721,12 @@ def get_python_parser(
p = parse36.Python36Parser(debug_parser)
else:
p = parse36.Python36ParserSingle(debug_parser)
elif version == 3.7:
import uncompyle6.parsers.parse37 as parse37
if compile_mode == 'exec':
p = parse37.Python37Parser(debug_parser)
else:
p = parse37.Python37ParserSingle(debug_parser)
else:
if compile_mode == 'exec':
p = parse3.Python3Parser(debug_parser)

View File

@@ -27,6 +27,15 @@ class Python37Parser(Python36Parser):
super(Python37Parser, self).__init__(debug_parser)
self.customized = {}
def p_37misc(self, args):
"""
# Where does the POP_TOP really belong?
stmt ::= import37
import37 ::= import POP_TOP
# Is there a pattern here?
attributes ::= IMPORT_FROM ROT_TWO POP_TOP IMPORT_FROM
"""
class Python37ParserSingle(Python37Parser, PythonParserSingle):
pass