"withstmt" -> "with" and fix async for

This commit is contained in:
rocky
2020-04-01 09:48:34 -04:00
parent e2d349f781
commit a616e1e1c7
18 changed files with 66 additions and 48 deletions

View File

@@ -1271,7 +1271,7 @@ class Python37Parser(Python37BaseParser):
self.addRule(rule, nop_func)
elif opname == "SETUP_WITH":
rules_str = """
withstmt ::= expr SETUP_WITH POP_TOP suite_stmts_opt COME_FROM_WITH
with ::= expr SETUP_WITH POP_TOP suite_stmts_opt COME_FROM_WITH
WITH_CLEANUP_START WITH_CLEANUP_FINISH END_FINALLY
# Removes POP_BLOCK LOAD_CONST from 3.6-
@@ -1280,13 +1280,13 @@ class Python37Parser(Python37BaseParser):
"""
if self.version < 3.8:
rules_str += """
withstmt ::= expr SETUP_WITH POP_TOP suite_stmts_opt POP_BLOCK
with ::= expr SETUP_WITH POP_TOP suite_stmts_opt POP_BLOCK
LOAD_CONST
WITH_CLEANUP_START WITH_CLEANUP_FINISH END_FINALLY
"""
else:
rules_str += """
withstmt ::= expr SETUP_WITH POP_TOP suite_stmts_opt POP_BLOCK
with ::= expr SETUP_WITH POP_TOP suite_stmts_opt POP_BLOCK
BEGIN_FINALLY COME_FROM_WITH
WITH_CLEANUP_START WITH_CLEANUP_FINISH
END_FINALLY