Better "continue" detection on Python 3.0

This commit is contained in:
rocky
2018-06-12 04:47:29 -04:00
parent 170504c518
commit 600e56b1d7
2 changed files with 9 additions and 8 deletions

View File

@@ -34,6 +34,7 @@ class Python30Parser(Python31Parser):
ifelsestmtl ::= testexpr c_stmts_opt jb_pop_top else_suitel
iflaststmtl ::= testexpr c_stmts_opt jb_pop_top
iflaststmt ::= testexpr c_stmts_opt JUMP_ABSOLUTE POP_TOP
withasstmt ::= expr setupwithas store suite_stmts_opt
POP_BLOCK LOAD_CONST COME_FROM_FINALLY
@@ -76,8 +77,10 @@ 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
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
_ifstmts_jump ::= c_stmts_opt JUMP_FORWARD _come_froms
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