Reduce singletons rules and ..

fix recently introduced kwargs bug.
This commit is contained in:
rocky
2017-12-07 13:20:08 -05:00
parent b8b9b8463c
commit 08789adbb4
2 changed files with 3 additions and 3 deletions

View File

@@ -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)

View File

@@ -809,7 +809,7 @@ class Python3Parser(PythonParser):
opname, token.attr, customize)
if args_kw > 0:
kwargs_str = 'kwargs1 '
kwargs_str = 'kwargs '
else:
kwargs_str = ''