From 170504c5180b87d70db90da69166a66cf0e47046 Mon Sep 17 00:00:00 2001 From: rocky Date: Mon, 11 Jun 2018 11:54:08 -0400 Subject: [PATCH] Remove unused 3.0 grammar rules --- uncompyle6/parsers/parse30.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/uncompyle6/parsers/parse30.py b/uncompyle6/parsers/parse30.py index 426daec7..0bb0de99 100644 --- a/uncompyle6/parsers/parse30.py +++ b/uncompyle6/parsers/parse30.py @@ -33,6 +33,7 @@ class Python30Parser(Python31Parser): else_suitel ::= l_stmts COME_FROM_LOOP JUMP_BACK 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 POP_BLOCK LOAD_CONST COME_FROM_FINALLY @@ -74,6 +75,15 @@ class Python30Parser(Python31Parser): def customize_grammar_rules(self, 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 pass