The parser cache in RAM has now grammar versioning.

This commit is contained in:
Dave Halter
2017-05-26 12:48:59 -04:00
parent f997b91a12
commit dafffdc9b4
4 changed files with 25 additions and 28 deletions

View File

@@ -54,7 +54,7 @@ class Differ(object):
def initialize(self, code):
logging.debug('differ: initialize')
self.lines = splitlines(code, keepends=True)
cache.parser_cache.pop(None, None)
cache.parser_cache[self.grammar._hashed].pop(None, None)
self.module = parse(code, diff_cache=True, cache=True)
return self.module