Browse Source

Minor version bump + Adjustments to PR

tags/gm/2021-09-23T00Z/github.com--lark-parser-lark/0.11.0
Erez Sh 4 years ago
parent
commit
798a7026b4
3 changed files with 4 additions and 7 deletions
  1. +1
    -1
      lark/__init__.py
  2. +1
    -2
      lark/lark.py
  3. +2
    -4
      lark/parser_frontends.py

+ 1
- 1
lark/__init__.py View File

@@ -7,4 +7,4 @@ from .exceptions import (ParseError, LexError, GrammarError, UnexpectedToken,
from .lexer import Token
from .lark import Lark

__version__ = "0.10.0"
__version__ = "0.10.1"

+ 1
- 2
lark/lark.py View File

@@ -336,8 +336,7 @@ class Lark(Serialize):
Useful for caching and multiprocessing.
"""
data, m = self.memo_serialize([TerminalDef, Rule])
pickle.dump({'data': data, 'memo': m}, f,
protocol=pickle.HIGHEST_PROTOCOL)
pickle.dump({'data': data, 'memo': m}, f, protocol=pickle.HIGHEST_PROTOCOL)

@classmethod
def load(cls, f):


+ 2
- 4
lark/parser_frontends.py View File

@@ -82,13 +82,11 @@ class WithLexer(_ParserFrontend):
self.postlex = lexer_conf.postlex

@classmethod
def deserialize(cls, data, memo, callbacks, postlex, transformer, re_module,
debug):
def deserialize(cls, data, memo, callbacks, postlex, transformer, re_module, debug):
inst = super(WithLexer, cls).deserialize(data, memo)

inst.postlex = postlex
inst.parser = LALR_Parser.deserialize(inst.parser, memo, callbacks,
debug)
inst.parser = LALR_Parser.deserialize(inst.parser, memo, callbacks, debug)

terminals = [item for item in memo.values() if isinstance(item, TerminalDef)]
inst.lexer_conf.callbacks = _get_lexer_callbacks(transformer, terminals)


Loading…
Cancel
Save