Browse Source

Cache now also depends on the Lark version

tags/gm/2021-09-23T00Z/github.com--lark-parser-lark/0.8.9
Erez Sh 4 years ago
parent
commit
46bb1e1d63
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      lark/lark.py

+ 2
- 1
lark/lark.py View File

@@ -180,8 +180,9 @@ class Lark(Serialize):
if self.options.cache is not True:
raise ValueError("cache must be bool or str")
unhashable = ('transformer', 'postlex', 'lexer_callbacks', 'edit_terminals')
from . import __version__
options_str = ''.join(k+str(v) for k, v in options.items() if k not in unhashable)
s = grammar + options_str
s = grammar + options_str + __version__
md5 = hashlib.md5(s.encode()).hexdigest()
cache_fn = '.lark_cache_%s.tmp' % md5



Loading…
Cancel
Save