NT "_for" -> "for_iter" reduces confusion w/ "for"

This commit is contained in:
rocky
2017-12-12 12:41:44 -05:00
parent b544827192
commit 84b4ac1c51
8 changed files with 27 additions and 27 deletions

View File

@@ -38,8 +38,8 @@ class Python3Parser(PythonParser):
# one may be a continue - sometimes classifies a JUMP_BACK
# as a CONTINUE. The two are kind of the same in a comprehension.
comp_for ::= expr _for store comp_iter CONTINUE
comp_for ::= expr _for store comp_iter JUMP_BACK
comp_for ::= expr for_iter store comp_iter CONTINUE
comp_for ::= expr for_iter store comp_iter JUMP_BACK
list_comp ::= BUILD_LIST_0 list_iter
lc_body ::= expr LIST_APPEND
@@ -328,16 +328,16 @@ class Python3Parser(PythonParser):
def p_loop_stmt3(self, args):
"""
for ::= SETUP_LOOP expr _for store for_block POP_BLOCK
for ::= SETUP_LOOP expr for_iter store for_block POP_BLOCK
COME_FROM_LOOP
forelsestmt ::= SETUP_LOOP expr _for store for_block POP_BLOCK else_suite
forelsestmt ::= SETUP_LOOP expr for_iter store for_block POP_BLOCK else_suite
COME_FROM_LOOP
forelselaststmt ::= SETUP_LOOP expr _for store for_block POP_BLOCK else_suitec
forelselaststmt ::= SETUP_LOOP expr for_iter store for_block POP_BLOCK else_suitec
COME_FROM_LOOP
forelselaststmtl ::= SETUP_LOOP expr _for store for_block POP_BLOCK else_suitel
forelselaststmtl ::= SETUP_LOOP expr for_iter store for_block POP_BLOCK else_suitel
COME_FROM_LOOP
whilestmt ::= SETUP_LOOP testexpr l_stmts_opt COME_FROM JUMP_BACK POP_BLOCK
@@ -372,7 +372,7 @@ class Python3Parser(PythonParser):
COME_FROM_LOOP
whileTruestmt ::= SETUP_LOOP l_stmts_opt JUMP_BACK POP_BLOCK NOP
COME_FROM_LOOP
for ::= SETUP_LOOP expr _for store for_block POP_BLOCK NOP
for ::= SETUP_LOOP expr for_iter store for_block POP_BLOCK NOP
COME_FROM_LOOP
"""