X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/4d3107233f18452d89e3caf148a098849a16b364..ffa676cd7d332e9fa5808d824f5a31f03ab9a5d0:/blib2to3/pgen2/grammar.py diff --git a/blib2to3/pgen2/grammar.py b/blib2to3/pgen2/grammar.py index b20b923..32d1d8b 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):