lark

Lark is a parsing toolkit for Python, built with a focus on ergonomics, performance and modularity.

MIT License

Downloads
14.7M
Stars
4.8K
Committers
119

Bot releases are hidden (Show)

lark - 1.2.2 - Bugfix for 1.2.1 (Earley issues with ambiguity) Latest Release

Published by erezsh 2 months ago

What's Changed

Full Changelog: https://github.com/lark-parser/lark/compare/1.2.1...1.2.2

lark - 1.2.1 - Now only Python 3.8+; several bugfixes in Earley

Published by erezsh 2 months ago

Main Changes

  • Dropped support for Python versions lower than 3.8
  • Several bugfixes in the Earley algorithm, related to suppressed ambiguities
  • Improved performance in InteractiveParser.accepts()

What's Changed

New Contributors

Full Changelog: https://github.com/lark-parser/lark/compare/1.1.9...1.2.1

lark - 1.1.9 - Patch for a breaking change in 3.11.7 re module

Published by erezsh 9 months ago

What's Changed

New Contributors

Full Changelog: https://github.com/lark-parser/lark/compare/1.1.8...1.1.9

What's Changed

New Contributors

Full Changelog: https://github.com/lark-parser/lark/compare/1.1.7...1.1.8

lark - 1.1.7 - Bugfix for release 1.1.6 in propagate_positions

Published by erezsh about 1 year ago

Bugfix in propagate_positions (issue #1304)

See: https://github.com/lark-parser/lark/releases/tag/1.1.6

lark - 1.1.6 - Strict mode, Python-style comments, Bugfixes

Published by erezsh over 1 year ago

What's Changed - main points

What's Changed - PRs

New Contributors

Full Changelog: https://github.com/lark-parser/lark/compare/1.1.5...1.1.6

lark - 1.1.5 - Fix AmbiguousExpander; Fix line information in InteractiveParser

Published by erezsh almost 2 years ago

What's Changed

New Contributors

Full Changelog: https://github.com/lark-parser/lark/compare/1.1.4...1.1.5

What's Changed

New Contributors

Full Changelog: https://github.com/lark-parser/lark/compare/1.1.3...1.1.4

lark - 1.1.3 - Various fixes and refactors

Published by erezsh about 2 years ago

What's Changed

New Contributors

Full Changelog: https://github.com/lark-parser/lark/compare/1.1.2...1.1.3

lark - 1.1.2 - Small fixes; Support for printing trees with "rich"

Published by erezsh over 2 years ago

Highlights

  • Tree instances now have a pretty print with the "rich" library, when doing rich.print(tree)
  • Bugfix for recursive regexes (with the "regex" library)
  • Refactors, cleanups, and better mypy support

What's Changed

New Contributors

Full Changelog: https://github.com/lark-parser/lark/compare/1.1.1...1.1.2

lark - Mypy fixes, and improvements to the InteractiveParser API

Published by erezsh over 2 years ago

What's Changed

New Contributors

Full Changelog: https://github.com/lark-parser/lark/compare/1.1.0...1.1.1

lark - Version 1.1.0

Published by erezsh over 2 years ago

  • Better support for typing and mypy. Includes generic tree typing (Thanks @plannigan!)

  • Improvements to python.lark (walrus operator, slashes in function params, and more). Now parses the entire Python 3.10 lib successfully

  • Bugfixes:

    • Transformer.__default__ not called in tree-less LALR mode (Issue #1029)
    • v_args failed to apply to class under standalone parser (Issue #1059)
    • maybe_placeholders incorrectly accumulated params when it encountered the | operator (Issue #1078)
lark - Version 1.0! Big release with breaking changes

Published by erezsh almost 3 years ago

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.
lark - 0.12.0 - Several improvements + Announcements

Published by erezsh about 3 years ago

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: https://github.com/lark-parser/lark/pull/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

lark - InteractiveParser & Better Cache

Published by erezsh over 3 years ago

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: https://github.com/lark-parser/lark/discussions/874

Thanks for everyone who helped make Lark better!

lark - Better grammar re-use, and tons of improvements

Published by erezsh over 3 years ago

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

lark - Small bugfix in the Earley parser

Published by erezsh almost 4 years ago

lark - Many bugfixes and improvements

Published by erezsh almost 4 years ago

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

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

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

Published by erezsh about 4 years ago

  • Complete overhaul of documentation. Now using sphinx to generate API docs from docstrings. (commit 0664cbd3d3c19e321cae8df044839e7baf7135af. Thank you @chsasank !)

    • Many improvements and additions to documentation
  • New and friendlier Earley SPPF interface! (commit 555b268eb26bcbfce64991ea7517338dee85a840. 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 7dc00179e63efa6e98d688bfba3265d382db79c4)

  • Terminals can now be composed of regexps and strings with different flags, if using Python 3.6+ (commit e6fc3c9b00306e3a8661210fcc93bf50479ee229)

  • Added support for parsing byte-strings, with the use_bytes flag (commit 9ee8428f3f6ad285ad93e2b62ec47d33fff54768).

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

  • Allow multiline regexes with the x flag (commit 9923987e94547ded8a17d7a03840c4cebce39188)

  • Lark no longer uses the default logger. Instead uses lark.LOGGER. (commit 7010f96825b5fbac79522d1b30689065df53dc8c)

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

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

lark - Better regexps, and new error handling

Published by erezsh over 4 years ago

Package Rankings
Top 0.8% on Pypi.org
Top 2.03% on Alpine-v3.18
Top 22.66% on Anaconda.org
Top 3.78% on Alpine-edge
Top 8.41% on Alpine-v3.16
Top 4.34% on Alpine-v3.17
Top 9.53% on Conda-forge.org
Badges
Extracted from project README
Tests codecov