"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

@@ -50,7 +50,7 @@ class Python35Parser(Python34Parser):
# Python 3.5+ has WITH_CLEANUP_START/FINISH
withstmt ::= expr
with ::= expr
SETUP_WITH POP_TOP suite_stmts_opt
POP_BLOCK LOAD_CONST COME_FROM_WITH
WITH_CLEANUP_START WITH_CLEANUP_FINISH END_FINALLY
@@ -138,7 +138,7 @@ class Python35Parser(Python34Parser):
self.remove_rules("""
yield_from ::= expr GET_ITER LOAD_CONST YIELD_FROM
yield_from ::= expr expr YIELD_FROM
withstmt ::= expr SETUP_WITH POP_TOP suite_stmts_opt
with ::= expr SETUP_WITH POP_TOP suite_stmts_opt
POP_BLOCK LOAD_CONST COME_FROM_WITH
WITH_CLEANUP END_FINALLY
withasstmt ::= expr SETUP_WITH store suite_stmts_opt
@@ -209,10 +209,10 @@ class Python35Parser(Python34Parser):
elif opname == 'SETUP_WITH':
# Python 3.5+ has WITH_CLEANUP_START/FINISH
rules_str = """
withstmt ::= expr
SETUP_WITH POP_TOP suite_stmts_opt
POP_BLOCK LOAD_CONST COME_FROM_WITH
WITH_CLEANUP_START WITH_CLEANUP_FINISH END_FINALLY
with ::= expr
SETUP_WITH POP_TOP suite_stmts_opt
POP_BLOCK LOAD_CONST COME_FROM_WITH
WITH_CLEANUP_START WITH_CLEANUP_FINISH END_FINALLY
withasstmt ::= expr
SETUP_WITH store suite_stmts_opt