π LALR parser
π The LALR parser now supports priority in rules, as a way to resolve collision errors
π Improvements to the standalone tool, including more command-line options, like optional compression for the json data.
π Improvements to the puppet error handling interface
π Better error reporting on LALR collisions
π Bugfixes in Earley
Misc
β Added support for syntax highlighting in Atom
π Fixes and improvements for the cache option. cache=True now uses a temporary directory instead of working directory.
π Lark can now be imported directly from a zip (See: ed5c8ec)
β Added more terminals to the grammar library (available for %import).
π Nearley tools now supports case insensitive strings
π Deprecated some interfaces
π Improvements to docs, stubs, and various bugfixes
π§ Thanks to @MegaIng for helping with Lark's maintenance, and to @ldbo, @chanicpanic, @michael-k, @ThatXliner and everyone else for their help and contributions.
π Complete overhaul of documentation. Now using sphinx to generate API docs from docstrings. (commit 0664cbd. Thank you @chsasank !)
π New and friendlier Earley SPPF interface! (commit 555b268. Thank you @chanicpanic !)
β Added the ambiguity='forest' option. Added ForestTransformer and TreeForestTranformer.
π Various Bugfixes to improve the handling of ambiguous results.
β Read the docs here: https://lark-parser.readthedocs.io/en/latest/forest.html
π New Vim syntax highlighting for Lark (https://github.com/lark-parser/vim-lark-syntax Thank you @omega16 !)
π Lark now loads faster from cache (commit 7dc0017)
π Terminals can now be composed of regexps and strings with different flags, if using Python 3.6+ (commit e6fc3c9)
β Added support for parsing byte-strings, with the use_bytes flag (commit 9ee8428).
π UnexpectedToken exception now has the accepts attribute, which contains a list of terminals that would be accepted by the parser instead (in addition to the expects attribute, which is guided by the lexer and may include terminals that won't be accepted by the parser) (commit a7bcd0b)
π Allow multiline regexes with the x flag (commit 9923987)
0οΈβ£ Lark no longer uses the default logger. Instead uses lark.LOGGER. (commit 7010f96)
π² Lark now notifies on unused terminals/rules through logging.debug.
π Standalone generator now creates smaller files (without comments and docstrings). Also undergone various fixes. (commit bf2d9bf)
Wheel distribution due to (somewhat) popular demand.
π Lots of small bugfixes and improvements!
π Many thanks to @MegaIng for his continued work on many of these new features and fixes, and to everyone else who contributed to Lark and helped make it even better.
β Added error handling to LALR!
on_error option to Lark.parse().π Support for better regexps with the regex module, when using Lark(..., regex=True)
β
Read here: https://lark-parser.readthedocs.io/en/latest/classes/#using-unicode-character-classes-with-regex
π The last two releases were wrong. I apologize.
π Hopefully that's the last of it, and we'll be back on track with periodic and accurate releases.
π The main features for this release:
Grammar caching : It's now possible to cache the results of the LALR grammar analysis, for x2 to x3 faster loading. Use Lark(..., cache=True) or specify a file name. See here: https://lark-parser.readthedocs.io/en/latest/classes/
Grammar templates : Added support for grammar "functions" that expand in preprocessing. No docs yet, but see here for examples:
β
https://github.com/lark-parser/lark/blob/master/tests/test_parser.py#L845
Lark online IDE : Technically not a feature, but it's possible to run Lark in the browser. Now we also have a simple IDE on github pages: https://lark-parser.github.io/lark/ide/app.html
Other changes:
π Improved performance for large grammars
π¨ More debug prints when in debug mode
π Better support for PyInstaller
π Lots of bugfixes: mypy stubs, v_args, docs, and more.
g_regex_flags option, to allow applying flags to all terminals.end_pos for Earley, when using propagate_positions