Skip to content

Releases: lark-parser/lark

Version 1.0! Big release with breaking changes

15 Nov 08:22
Compare
Choose a tag to compare

Over the last few years, Lark has grown to become a comprehensive toolkit for parsing structured text.

Today, I'm happy to announce the long anticipated version 1.0 of Lark, marking the API as stable.

We've made quite a few breaking changes, in order to achieve congruous API with as little "gotchas" as possible. Upgrading to version 1.0 might require a few changes to your project.

Breaking changes

  • Dropped Python 2 support! Lark now only supports Python 3.6 and up.

  • Install lark using pip install lark (instead of lark-parser ).

  • maybe_placeholders is now True by default.

  • Renamed TraditionalLexer to BasicLexer, and 'standard' lexer option to 'basic'.

  • Default priority is now 0, for both terminals and rules (used to be 1 for terminals).

  • Discard mechanism is now done by returning Discard, instead of raising it as an exception.

  • use_accepts in UnexpectedInput.match_examples() is now True by default.

  • v_args(meta=True) now gives meta as the first argument. i.e. (meta, children).

Improvments

  • Better type annotations
  • Support for terminal priorities for dynamic Earley
  • Python3 grammar is now officially supported, and can be used via %import python (...)
  • New experimental feature: Tree Templates
  • Various bugfixes

Acknowledgements

Many thanks to all our contributors and donors, who made this release possible. Special thanks goes to -

  • @MegaIng, for innumerous features, bugfixes, and code-reviews.
  • @chanicpanic, for his immense and continual contributions to the Earley parser, and for helping with the v1.0 effort.
  • @erezsh, for being myself.

0.12.0 - Several improvements + Announcements

30 Aug 09:29
Compare
Choose a tag to compare

Announcements

  • This is likely to be the last major release that supports Python 2 !

We are now working on a Python3.6+ only v1.0 branch, which will soon become the default. See the work in progress: #925

Changes

  • Using rule repeat (~ syntax) is now much much faster for large numbers, thanks to @MegaIng

  • Bugfix for the propagate_positions option. Added option value propagate_positions='ignore_ws'.

  • Fixed reconstructor for when keep_all_tokens=True

  • Added merge_transformers (Thanks Robin!)

  • Many minor bugfixes, and improvements to code and docs

InteractiveParser & Better Cache

03 May 16:41
Compare
Choose a tag to compare

Cache

  • Lark now tracks changes in imported grammars (%import), and updates the cache if necessary
  • Added support for atomicwrites, for multiprocess caching and crash recovery

InteractiveParser

  • Now an official interface (renamed from Puppet)
  • Added Lark.parse_interactive() for starting the parser in interactive mode

Other

  • Added ast_utils, to assist in tranforming lark.Tree into a customized AST.

  • Better docs

  • Bugfixes

Notification: Support for Python 2 is ending

In the near future, Lark will drop support for Python 2. We will continue to develop for Python 3.6+ only, which will simplify the code and ease development.

Old releases (including this one) will still work, of course, and should be stable enough to accompany the remaining Python 2 users into the sunset.

If you have any objections, feel free to voice them here: #874

Thanks for everyone who helped make Lark better!

Better grammar re-use, and tons of improvements

16 Feb 15:11
Compare
Choose a tag to compare

New Features:

Improvements

  • Indenter now throws DedentError instead of AssertionError

  • Improved the Python3 grammar, now works with reconstructor. (See this example: https://github.com/lark-parser/lark/blob/master/examples/advanced/reconstruct_python.py)

  • Lots of refactoring for a better tomorrow.

  • rule/terminals names can now be in unicode. (thanks @julienmalard)

  • Better errors.

  • Better type hints.

  • lark.lark is now part of the standard library.

  • Earley:

    • Now works with match_examples()
    • Now supports a custom lexer
    • Better handling of ignored terminals
    • Faster forest visiting, and a few edge-case bugfixes (thanks @chanicpanic)

Other

Small bugfix in the Earley parser

16 Nov 19:49
Compare
Choose a tag to compare
0.11.1

Version bump to 0.11.1

Many bugfixes and improvements

16 Nov 12:28
Compare
Choose a tag to compare
  • 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.

New SPPF interface, new docs, and a long list of improvements

21 Sep 07:44
Compare
Choose a tag to compare
  • Complete overhaul of documentation. Now using sphinx to generate API docs from docstrings. (commit 0664cbd. Thank you @chsasank !)

    • Many improvements and additions to documentation
  • New and friendlier Earley SPPF interface! (commit 555b268. Thank you @chanicpanic !)

  • 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)

  • 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.

Better regexps, and new error handling

01 Jul 14:02
Compare
Choose a tag to compare

Minor release: Bugfix for PyInstaller (2)

16 Jun 12:02
Compare
Choose a tag to compare

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.

Minor release: Reverted EOF commit due to unexpected problems.

13 Jun 19:12
Compare
Choose a tag to compare