X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/4d3107233f18452d89e3caf148a098849a16b364..7ae084aaa13b8c1b66410de44f0b9f86ab798c5c:/blib2to3/pgen2/grammar.py diff --git a/blib2to3/pgen2/grammar.py b/blib2to3/pgen2/grammar.py index b20b923..aa025cf 100644 --- a/blib2to3/pgen2/grammar.py +++ b/blib2to3/pgen2/grammar.py @@ -13,7 +13,7 @@ fallback token code OP, but the parser needs the actual token code. """ # Python imports -import os.path +import os import pickle import tempfile @@ -85,6 +85,8 @@ class Grammar(object): self.tokens = {} self.symbol2label = {} self.start = 256 + # Python 3.7+ parses async as a keyword, not an identifier + self.async_keywords = False def dump(self, filename): """Dump the grammar tables to a pickle file.""" @@ -113,6 +115,7 @@ class Grammar(object): new.labels = self.labels[:] new.states = self.states[:] new.start = self.start + new.async_keywords = self.async_keywords return new def report(self): @@ -181,6 +184,7 @@ opmap_raw = """ // DOUBLESLASH //= DOUBLESLASHEQUAL -> RARROW +:= COLONEQUAL """ opmap = {}