More grammar cleanups

This commit is contained in:
rocky
2017-11-16 12:01:18 -05:00
parent d18a353381
commit 37108bc41c
2 changed files with 2 additions and 4 deletions

View File

@@ -227,6 +227,8 @@ class PythonParser(GenericASTBuilder):
suite_stmts ::= continue_stmts
suite_stmts_opt ::= suite_stmts
# passtmt is needed for semantic actions to add "pass"
suite_stmts_opt ::= passstmt
else_suite ::= suite_stmts

View File

@@ -679,10 +679,6 @@ class Python3Parser(PythonParser):
if opname_base == 'BUILD_TUPLE':
rule = ('load_closure ::= %s%s' % (('LOAD_CLOSURE ' * v), opname))
self.add_unique_rule(rule, opname, token.attr, customize)
rule = ('build_tuple ::= ' + 'expr1024 ' * int(v//1024) +
'expr32 ' * int((v//32) % 32) +
'expr ' * (v % 32) + opname)
self.add_unique_rule(rule, opname, token.attr, customize)
elif opname == 'LOOKUP_METHOD':
# A PyPy speciality - DRY with parse2
self.add_unique_rule("load_attr ::= expr LOOKUP_METHOD",