Erez Shinan
c637f3b35e
Version bump
6 years ago
Erez Shinan
1247a8c330
Improved error messages (as pointed out in issue #181 )
6 years ago
Erez Shinan
0240e1c248
Fixed issue where Lark would throw RecursionError for huge grammars (Issue #181 )
6 years ago
Erez Shinan
f99e2ecc86
Lark grammars are now utf8 by default (Issue #179 )
6 years ago
Erez Shinan
a49df1b2e4
Added option to provide a custom lexer (with example)
6 years ago
Erez Shinan
dee5ac776d
Fix for Python 3.7
6 years ago
Erez Shinan
e7212261b2
Fixed examples for error reporting
6 years ago
Erez Shinan
d11c67fea0
Fixed reconstruct
6 years ago
Erez Shinan
6ea4588bcf
Dynamic lexer is now returns the maximum match only. Complete lexing beahvior moved to "dynamic_complete"
Changed dynamic lexer behavior to only match terminals to their maximum length (i.e. greedy match), emulating the standard lexer.
The original dynamic lexer behavior, that attempts to match all appearances of a terminal, has been moved to the "dynamic_complete" lexer.
For example, when applying a terminal "a"+ to the text "aaa":
- dynamic: ["aaa"]
- dynamic_complete: ["a", "aa", "aaa"]
6 years ago
Erez Shinan
0e33217321
Updated version
6 years ago
Erez Shinan
5c6df8e825
Moved and restructured exceptions
* All exceptions are now under exceptions.py
* UnexpectedInput is now superclass of UnexpectedToken and UnexpectedCharacters,
all of which support the get_context() and match_examples() methods.
6 years ago
Erez Shinan
c0cf1b3176
Added some docstrings, removed is_terminal from common
6 years ago
Erez Shinan
c77934f6a2
Fixed nearley
6 years ago
Erez Shinan
6d76a4ce8d
visitor_args -> v_args
6 years ago
Erez Shinan
34cd792ffc
Fixed Python grammars, and a bug in newline detection
6 years ago
Erez Shinan
ac0d49e7ab
Added %declare
6 years ago
Erez Shinan
6bfc27c11d
New transformers near completion
Nearley tool still needs fixing
6 years ago
Erez Shinan
4864a1cf4d
More work
6 years ago
Erez Shinan
5e546f38a9
args decorators actually work now
6 years ago
Erez Shinan
9daacb9082
Refactored transformers, better code
6 years ago
Erez Shinan
1508dcd7c5
Refactored inline_args with smart_decorator
6 years ago
Erez Shinan
55e9d56792
Missed those at merge
6 years ago
Erez Shinan
2b4ef11ebf
Columns now start at 1
6 years ago
Erez Shinan
ea413fd648
Simplify PrepareAnonTerminals
6 years ago
Erez Shinan
0d56b0cf30
Anon terminals no longer need to start with _
6 years ago
Erez Shinan
7b32ffd83a
Fixed token visibility rules (Issue #109 )
Anonymous tokens would become visible if they had the same value as named tokens.
That's because they are merged for the lexer. But after this change, the rules for
visibility are based on their use in the rule, and not their name or identity.
6 years ago
Erez Shinan
c5e6cf0954
Refactoring to introduce Symbol instances before creating anons
6 years ago
Erez Shinan
1839c324d3
Small refactoring step
6 years ago
Erez Shinan
33caa391d5
Breaking backwards compatibility:
* Removed the scanless parsing feature (dynamic lexing is king)
* Default LALR lexer is now contextual
6 years ago
Erez Shinan
4a5aa745ea
All tests passing
6 years ago
Erez Shinan
cf7ddeee88
Earley working too
6 years ago
Erez Shinan
67f372c994
Symbols instead of strings - initial
6 years ago
Erez Shinan
51644a6c58
Added examples/lark.g - Reference implementation of the Lark grammar
(inspired by issue #116 )
6 years ago
Erez Shinan
4a7a66d773
.lark (preparing)
6 years ago
Erez Shinan
209a3fe8fd
Interface improvements for the Lark instance
6 years ago
Erez Shinan
0f0776c0fa
BUGIX in lexer: Embedding strings overwrote priority (Issue #121 )
6 years ago
Ramon Klass
1854b81ebc
interpreter: default behavior changed to return the values instead of discarding them, added test showcasing the behavior
6 years ago
Ramon Klass
f5550b3040
Implemented a new visitor class (Interpreter) that works top-down (PR #130 )
It emulates antlr's visitor behavior for a dynamic evaluation order of subtrees
6 years ago
Erez Shinan
9848cac9f0
Improved Lark's error reporting for grammar syntax errors (Based on PR #129 )
6 years ago
Erez Shinan
880f42dd12
Corrections to PR and added get_context
6 years ago
DrSlump
e69d567bce
example driven parser errors
6 years ago
Parker
138f1d5d76
Fix order of members when pickling Token
I found this while porting Token to C, essentially the value and pos_in_stream members of Token were swapped in ``__reduce__``, which means running ``pickle.loads`` and ``pickle.dumps`` would result in unpickled tokens whose value was the original's position in stream, and vice versa. In my C extension this caused a TypeError exception, but the behavior will have to be corrected in both.
6 years ago
Rob Rose
ca3d4ca6f4
Changing changes from .lrk to .lark
6 years ago
Erez Shinan
c3bce19dc2
More steps towards a good solution
6 years ago
Erez Shinan
f69bceb335
Snap more things into place
6 years ago
Erez Shinan
349a607ae3
Some more normalizing
6 years ago
Erez Shinan
f960c1b8ac
Initial: Added transformers.py, and Meta to tree
6 years ago
Erez Shinan
61afbed17a
A minor style fix (a possible memory usage improvement)
6 years ago
Erez Shinan
b9e1e444c9
Added SlottedTree
6 years ago
Erez Shinan
b951b5f79c
Significant reduction in memory consumption (Saving only parse-table instead of analysis instance)
6 years ago