3.8 ifelsestmt grammar rule...

and remove optional "c_stmts" in 3.7 "ifelsesmt" rule. We may
have to come back and add something, but when we do we'll be more
careful and this is probably all for the better.
This commit is contained in:
rocky
2020-01-22 22:50:27 -05:00
parent 31481de209
commit 29715bb8bf
4 changed files with 5 additions and 1 deletions

Binary file not shown.

View File

@@ -818,7 +818,7 @@ class Python37Parser(Python37BaseParser):
# This handles the case where a "JUMP_ABSOLUTE" is part
# of an inner if in c_stmts_opt
ifelsestmt ::= testexpr c_stmts_opt come_froms
ifelsestmt ::= testexpr c_stmts come_froms
else_suite come_froms
# ifelsestmt ::= testexpr c_stmts_opt jump_forward_else

View File

@@ -88,6 +88,10 @@ class Python38Parser(Python37Parser):
ifpoplaststmtl ::= testexpr POP_TOP c_stmts_opt JUMP_BACK
ifelsestmtl ::= testexpr c_stmts_opt jb_cfs else_suitel JUMP_BACK come_froms
# Keep indices the same in ifelsestmtl
cf_pt ::= COME_FROM POP_TOP
ifelsestmtl ::= testexpr c_stmts cf_pt else_suite
for38 ::= expr get_iter store for_block JUMP_BACK
for38 ::= expr get_for_iter store for_block JUMP_BACK
for38 ::= expr get_for_iter store for_block JUMP_BACK POP_BLOCK