lark
lark copied to clipboard
Lark is a parsing toolkit for Python, built with a focus on ergonomics, performance and modularity.
Based on previous PR by MegaIng. See #1429
**Suggestion** Recent versions of Bison are able to generate counter-examples witnessing shift/reduce and reduce/reduce conflicts, which helps fine-tuning the grammar so that it belongs to LR(1). Would it be feasible...
Fixes an issue overlooked by PR #1444 Addresses performance issues mentioned in #1443
The problem occurs because the terminals are defined in different namespaces, and therefor different names and instances, but may match the same text. An example is described here: https://stackoverflow.com/questions/78692900/unclear-reason-for-terminal-collision The...
Since lark version 1.2.1, there seem to be (more?) ambiguities produced for our syntax. While the syntax is ambiguous, we used prioritiies to fix this before. ``` %import common.INT %import...
`tests/test_cache.py` yields the following syntax warning starting with Python 3.12 (tested using Lark 1.2.1): ``` /path/to/lark/tests/test_cache.py:150: SyntaxWarning: invalid escape sequence '\w' ``` See https://github.com/lark-parser/lark/actions/runs/10367391039/job/28698690278 for an example.
**Describe the bug** Using a priority after a terminal works fine for non-recursive rules, however in a recursive rule it fails to apply how I expected - see below reproduction...
**What is your question?** I am porting from pyparsing to Lark due to expectations on increased performance. Initial test show very promising. One of the few constructs that I could...
Below are two simple grammars. The first one produces 2 identical derivations, and the second one produces 4 identical derivations. @chanicpanic If you have the time, maybe you could take...