Lark

Latest version: v1.1.9

Safety actively analyzes 638646 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 2 of 9

1.1.3

What's Changed

* Add user to cache filename; better handle cache load/save failures by klauer in https://github.com/lark-parser/lark/pull/1179
* refactor: add 'usedforsecurity=False' arg to hashlib.md5 usage by cquick01 in https://github.com/lark-parser/lark/pull/1190
* Create lark/grammars/__init__.py by chanicpanic in https://github.com/lark-parser/lark/pull/1171
* Adjust imports for Python 3.11 by The-Compiler in https://github.com/lark-parser/lark/pull/1140
* Fix for issue 1173 by erezsh in https://github.com/lark-parser/lark/pull/1198

* Add match stmt support to python.lark by joseph-e-k in https://github.com/lark-parser/lark/pull/1123
* Added match stmt support to python.lark by MegaIng in https://github.com/lark-parser/lark/pull/1016
* Linting to fix minor issues by Erotemic in https://github.com/lark-parser/lark/pull/1128
* Simplify lexer: Use Match.lastgroup instead of lastindex by erezsh in https://github.com/lark-parser/lark/pull/1129
* Fix confusing import in examples by JonasLoos in https://github.com/lark-parser/lark/pull/1138
* Move iter_subtrees_topdown into standalone by camgunz in https://github.com/lark-parser/lark/pull/1137
* Fix 1146: use the class's __get__ instead of the instance's __get__ by MegaIng in https://github.com/lark-parser/lark/pull/1147
* fix: remove Python 2 legacy packaging code by henryiii in https://github.com/lark-parser/lark/pull/1148
* Fix for PR 1149 by erezsh in https://github.com/lark-parser/lark/pull/1150
* Old link for sppf is no longer valid. Point to web archive instead. by patrickhuber in https://github.com/lark-parser/lark/pull/1159
* Fix ForestToPyDotVisitor by chanicpanic in https://github.com/lark-parser/lark/pull/1167
* Close file-like objects to address ResourceWarning. by shawnbrown in https://github.com/lark-parser/lark/pull/1183
* Minor adjustments to PR 1179 by erezsh in https://github.com/lark-parser/lark/pull/1189
* Adjustments for PR 1152 by erezsh in https://github.com/lark-parser/lark/pull/1191
* Remove trailing whitespace by bcr in https://github.com/lark-parser/lark/pull/1196

New Contributors
* joseph-e-k made their first contribution in https://github.com/lark-parser/lark/pull/1123
* Erotemic made their first contribution in https://github.com/lark-parser/lark/pull/1128
* JonasLoos made their first contribution in https://github.com/lark-parser/lark/pull/1138
* camgunz made their first contribution in https://github.com/lark-parser/lark/pull/1137
* The-Compiler made their first contribution in https://github.com/lark-parser/lark/pull/1140
* henryiii made their first contribution in https://github.com/lark-parser/lark/pull/1148
* patrickhuber made their first contribution in https://github.com/lark-parser/lark/pull/1159
* shawnbrown made their first contribution in https://github.com/lark-parser/lark/pull/1183
* klauer made their first contribution in https://github.com/lark-parser/lark/pull/1179
* cquick01 made their first contribution in https://github.com/lark-parser/lark/pull/1190
* bcr made their first contribution in https://github.com/lark-parser/lark/pull/1196

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

1.1.2

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
* Clean up tree templates implementation to reduce mypy errors by plannigan in https://github.com/lark-parser/lark/pull/1091
* Remove redefinitions related to standalone parser by plannigan in https://github.com/lark-parser/lark/pull/1115
* Added Tree.__rich__() method to make Tree a Rich renderable by erezsh in https://github.com/lark-parser/lark/pull/1117
* Rename lexer_state->lexer_thread, and make a few adjustments for the benefit of Lark-Cython by erezsh in https://github.com/lark-parser/lark/pull/1118
* Use isinstance() checks in expcetions match_examples() by plannigan in https://github.com/lark-parser/lark/pull/1065
* change MAXREPEAT to int by gruebel in https://github.com/lark-parser/lark/pull/1120
* Tests: Small fixes by erezsh in https://github.com/lark-parser/lark/pull/1122

New Contributors
* gruebel made their first contribution in https://github.com/lark-parser/lark/pull/1120

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

1.1.1

What's Changed
* Add test cases for tree templates by plannigan in https://github.com/lark-parser/lark/pull/1096
* 🖊 Fix Typo: plural "options" instead of singular "option" by hf-kklein in https://github.com/lark-parser/lark/pull/1101
* PEP 8: Minor Code Style Improvements by hf-kklein in https://github.com/lark-parser/lark/pull/1102
* Add Code Style Section to Contribution Guide by hf-kklein in https://github.com/lark-parser/lark/pull/1107
* Fix MyPy Warnings in lark/tools/__init__.py by hf-kklein in https://github.com/lark-parser/lark/pull/1100
* rename `n` to `child` when iterating over `children` by hf-kklein in https://github.com/lark-parser/lark/pull/1110
* specify ignored mypy error by using `type: ignore[error]` in lark/tree.py and lark/utils.py by hf-kklein in https://github.com/lark-parser/lark/pull/1099
* Add `py.typed` to package_data of lark package by hf-kklein in https://github.com/lark-parser/lark/pull/1109
* InteractiveParser: Added `iter_parse()` method, for easier instrumentation by erezsh in https://github.com/lark-parser/lark/pull/1111

New Contributors
* hf-kklein made their first contribution in https://github.com/lark-parser/lark/pull/1101

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

1.1.0

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

1.0.0

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

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

- We also have a new online IDE! Check it out here: https://lark-parser.github.io/ide

- Lark can now generate standalone Javascript parsers! Check it out here: https://github.com/lark-parser/Lark.js (still in beta)

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

Page 2 of 9

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.