Python 2.5 "with"; Isolate 2.5-2.6 grammar better

This commit is contained in:
rocky
2017-11-16 09:26:23 -05:00
parent 953cf312db
commit 53beae8ee6
4 changed files with 21 additions and 1 deletions

View File

@@ -251,6 +251,11 @@ class Python26Parser(Python2Parser):
"""
def add_custom_rules(self, tokens, customize):
self.remove_rules("""
withasstmt ::= expr SETUP_WITH designator suite_stmts_opt
POP_BLOCK LOAD_CONST COME_FROM_WITH
WITH_CLEANUP END_FINALLY
""")
super(Python26Parser, self).add_custom_rules(tokens, customize)
self.check_reduce['and'] = 'AST'