You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-04 01:09:52 +08:00
Remove unused 3.0 grammar rules
This commit is contained in:
@@ -33,6 +33,7 @@ class Python30Parser(Python31Parser):
|
|||||||
else_suitel ::= l_stmts COME_FROM_LOOP JUMP_BACK
|
else_suitel ::= l_stmts COME_FROM_LOOP JUMP_BACK
|
||||||
|
|
||||||
ifelsestmtl ::= testexpr c_stmts_opt jb_pop_top else_suitel
|
ifelsestmtl ::= testexpr c_stmts_opt jb_pop_top else_suitel
|
||||||
|
iflaststmtl ::= testexpr c_stmts_opt jb_pop_top
|
||||||
|
|
||||||
withasstmt ::= expr setupwithas store suite_stmts_opt
|
withasstmt ::= expr setupwithas store suite_stmts_opt
|
||||||
POP_BLOCK LOAD_CONST COME_FROM_FINALLY
|
POP_BLOCK LOAD_CONST COME_FROM_FINALLY
|
||||||
@@ -74,6 +75,15 @@ class Python30Parser(Python31Parser):
|
|||||||
|
|
||||||
def customize_grammar_rules(self, tokens, customize):
|
def customize_grammar_rules(self, tokens, customize):
|
||||||
super(Python30Parser, self).customize_grammar_rules(tokens, customize)
|
super(Python30Parser, self).customize_grammar_rules(tokens, customize)
|
||||||
|
self.remove_rules("""
|
||||||
|
iflaststmtl ::= testexpr c_stmts_opt JUMP_BACK COME_FROM_LOOP
|
||||||
|
ifelsestmtl ::= testexpr c_stmts_opt JUMP_BACK else_suitel
|
||||||
|
jump_forward_else ::= JUMP_FORWARD ELSE
|
||||||
|
jump_absolute_else ::= JUMP_ABSOLUTE ELSE
|
||||||
|
whilestmt ::= SETUP_LOOP testexpr l_stmts_opt COME_FROM JUMP_BACK POP_BLOCK
|
||||||
|
COME_FROM_LOOP
|
||||||
|
""")
|
||||||
|
|
||||||
return
|
return
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user