You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-04 09:22:40 +08:00
More grammar cleanups
This commit is contained in:
@@ -227,6 +227,8 @@ class PythonParser(GenericASTBuilder):
|
|||||||
suite_stmts ::= continue_stmts
|
suite_stmts ::= continue_stmts
|
||||||
|
|
||||||
suite_stmts_opt ::= suite_stmts
|
suite_stmts_opt ::= suite_stmts
|
||||||
|
|
||||||
|
# passtmt is needed for semantic actions to add "pass"
|
||||||
suite_stmts_opt ::= passstmt
|
suite_stmts_opt ::= passstmt
|
||||||
|
|
||||||
else_suite ::= suite_stmts
|
else_suite ::= suite_stmts
|
||||||
|
@@ -679,10 +679,6 @@ class Python3Parser(PythonParser):
|
|||||||
if opname_base == 'BUILD_TUPLE':
|
if opname_base == 'BUILD_TUPLE':
|
||||||
rule = ('load_closure ::= %s%s' % (('LOAD_CLOSURE ' * v), opname))
|
rule = ('load_closure ::= %s%s' % (('LOAD_CLOSURE ' * v), opname))
|
||||||
self.add_unique_rule(rule, opname, token.attr, customize)
|
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':
|
elif opname == 'LOOKUP_METHOD':
|
||||||
# A PyPy speciality - DRY with parse2
|
# A PyPy speciality - DRY with parse2
|
||||||
self.add_unique_rule("load_attr ::= expr LOOKUP_METHOD",
|
self.add_unique_rule("load_attr ::= expr LOOKUP_METHOD",
|
||||||
|
Reference in New Issue
Block a user