You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-03 00:45:53 +08:00
Reduce singletons rules and ..
fix recently introduced kwargs bug.
This commit is contained in:
@@ -50,7 +50,7 @@ class PythonParser(GenericASTBuilder):
|
||||
# FIXME: would love to do expr, sstmts, stmts and
|
||||
# so on but that would require major changes to the
|
||||
# semantic actions
|
||||
self.singleton = frozenset(('str', 'joined_str', 'store',
|
||||
self.singleton = frozenset(('str', 'joined_str', 'store', '_stmts', 'suite_stmts_opt',
|
||||
'inplace_op'))
|
||||
|
||||
def ast_first_offset(self, ast):
|
||||
@@ -161,7 +161,7 @@ class PythonParser(GenericASTBuilder):
|
||||
def nonterminal(self, nt, args):
|
||||
n = len(args)
|
||||
|
||||
# Use this to find lots of singleton rule
|
||||
# # Use this to find lots of singleton rule
|
||||
# if n == 1 and nt not in self.singleton:
|
||||
# print("XXX", nt)
|
||||
|
||||
|
@@ -809,7 +809,7 @@ class Python3Parser(PythonParser):
|
||||
opname, token.attr, customize)
|
||||
|
||||
if args_kw > 0:
|
||||
kwargs_str = 'kwargs1 '
|
||||
kwargs_str = 'kwargs '
|
||||
else:
|
||||
kwargs_str = ''
|
||||
|
||||
|
Reference in New Issue
Block a user