Add the grammar as an argument to saving the parser.
This makes collisions of different grammars when loading from the cache impossible.
This commit is contained in:
1 parent
c41bee4253
commit
26cce4d078
10 files changed
+41
-34
No files matched your search
@@ -146,10 +146,10 @@ class NewDiffParser(object):
|
||||
lines##### TODO
|
||||
tokens = tokenize(lines)
|
||||
if self._module is None:
|
||||
self._module = load_parser(self._path)
|
||||
self._module = load_parser(grammar, self._path)
|
||||
if self._module is None:
|
||||
self._module = self._parser.parse(tokens)
|
||||
save_parser(self._path, self._module)
|
||||
save_parser(grammar, self._path, self._module)
|
||||
return self._module
|
||||
|
||||
return bla
|
||||
|
||||
Reference in new issue
Block a user