Add 3.6 withas rule

This commit is contained in:
rocky
2017-12-14 09:50:06 -05:00
parent a464e41ad9
commit 8e15246951
2 changed files with 6 additions and 2 deletions

Binary file not shown.

View File

@@ -118,8 +118,12 @@ class Python36Parser(Python35Parser):
self.addRule(rule, nop_func) self.addRule(rule, nop_func)
elif opname == 'SETUP_WITH': elif opname == 'SETUP_WITH':
rules_str = """ rules_str = """
withstmt ::= expr SETUP_WITH POP_TOP suite_stmts_opt POP_BLOCK LOAD_CONST withstmt ::= expr SETUP_WITH POP_TOP suite_stmts_opt POP_BLOCK LOAD_CONST
WITH_CLEANUP_START WITH_CLEANUP_FINISH END_FINALLY WITH_CLEANUP_START WITH_CLEANUP_FINISH END_FINALLY
# Removes POP_BLOCK LOAD_CONST from 3.6-
withasstmt ::= expr SETUP_WITH store suite_stmts_opt COME_FROM_WITH
WITH_CLEANUP_START WITH_CLEANUP_FINISH END_FINALLY
""" """
self.addRule(rules_str, nop_func) self.addRule(rules_str, nop_func)