You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-03 00:45:53 +08:00
Some grammar cleanup based on coverage info
This commit is contained in:
@@ -24,9 +24,7 @@ class Python30Parser(Python31Parser):
|
||||
|
||||
# FIXME: combine with parse3.2
|
||||
whileTruestmt ::= SETUP_LOOP l_stmts_opt
|
||||
JUMP_BACK COME_FROM_LOOP
|
||||
whileTruestmt ::= SETUP_LOOP l_stmts_opt
|
||||
CONTINUE COME_FROM_LOOP
|
||||
jb_or_c COME_FROM_LOOP
|
||||
whileTruestmt ::= SETUP_LOOP returns
|
||||
COME_FROM_LOOP
|
||||
|
||||
@@ -205,6 +203,18 @@ class Python30Parser(Python31Parser):
|
||||
|
||||
def remove_rules_30(self):
|
||||
self.remove_rules("""
|
||||
|
||||
# The were found using grammar coverage
|
||||
while1stmt ::= SETUP_LOOP l_stmts COME_FROM JUMP_BACK COME_FROM_LOOP
|
||||
whileTruestmt ::= SETUP_LOOP l_stmts_opt JUMP_BACK POP_BLOCK COME_FROM_LOOP
|
||||
whileelsestmt ::= SETUP_LOOP testexpr l_stmts_opt JUMP_BACK POP_BLOCK else_suitel COME_FROM_LOOP
|
||||
whilestmt ::= SETUP_LOOP testexpr l_stmts_opt JUMP_BACK POP_BLOCK COME_FROM_LOOP
|
||||
whilestmt ::= SETUP_LOOP testexpr l_stmts_opt JUMP_BACK POP_BLOCK JUMP_BACK COME_FROM_LOOP
|
||||
whilestmt ::= SETUP_LOOP testexpr returns POP_TOP POP_BLOCK COME_FROM_LOOP
|
||||
withasstmt ::= expr SETUP_WITH store suite_stmts_opt POP_BLOCK LOAD_CONST COME_FROM_WITH WITH_CLEANUP END_FINALLY
|
||||
withstmt ::= expr SETUP_WITH POP_TOP suite_stmts_opt POP_BLOCK LOAD_CONST COME_FROM_WITH WITH_CLEANUP END_FINALLY
|
||||
##########################################################################################
|
||||
|
||||
iflaststmtl ::= testexpr c_stmts_opt JUMP_BACK COME_FROM_LOOP
|
||||
ifelsestmtl ::= testexpr c_stmts_opt JUMP_BACK else_suitel
|
||||
iflaststmt ::= testexpr c_stmts_opt JUMP_ABSOLUTE
|
||||
@@ -224,6 +234,7 @@ class Python30Parser(Python31Parser):
|
||||
whileelsestmt ::= SETUP_LOOP testexpr l_stmts JUMP_BACK POP_BLOCK
|
||||
else_suitel COME_FROM_LOOP
|
||||
|
||||
################################################################
|
||||
# No JUMP_IF_FALSE_OR_POP, JUMP_IF_TRUE_OR_POP,
|
||||
# POP_JUMP_IF_FALSE, or POP_JUMP_IF_TRUE
|
||||
|
||||
|
Reference in New Issue
Block a user