Erez Sh
ae691bf35e
Revert propagate_positions to be False by default, still not ready for prime-time
5 years ago
Erez Sh
b2f1b3bf7c
Small fixes
5 years ago
Erez Sh
f0da22e9a8
LarkOptions now raises AttributeError instead of KeyError (Issue #503 )
5 years ago
Erez Sh
b9c81a5450
Refactor: Simplify code by assuming rule.options is never None
5 years ago
Erez Sh
fbbea5f730
Removed deprecated feature - profile
5 years ago
Erez Shinan
1815bd7fbd
Support for token visitation in internal transformers, as an alternative mechanism for lexer_callbacks
5 years ago
Erez Shinan
84f08a452f
propagate_positions & maybe_placeholders are now true by default, updated docs, tests & examples accordingly (Issue #449 , #451 )
5 years ago
Erez Sh
35e1029034
Start parameter now accepts unicode in Python 2 (Issue #459 )
5 years ago
Erez Sh
bb57629418
Added 'edit_terminals' option (Issue #406 )
5 years ago
Erez Shinan
0d164bd344
Added get_terminal() method (Issue #412 )
5 years ago
Erez Shinan
94e7e82a19
Updated docstrings for multiple start symbols
5 years ago
Erez Shinan
f1e844accd
Mid work. Not promising
5 years ago
Erez Shinan
e79689dce7
Remove unused rules (Issue #384 )
5 years ago
Erez Shinan
c5cb79307b
Fixes for new standalone (Issue #349 )
5 years ago
Erez Shinan
5ab12b031c
Added transformer, postlex arguments to standalone
5 years ago
Erez Shinan
ae51402cc7
Added serializer test
5 years ago
Erez Shinan
94e15fb6f7
Mid work. Almost stable
5 years ago
Erez Shinan
d13ebb9c15
Using a mostly-generic serialization method
5 years ago
Erez Shinan
066303fdab
Serialized lark is now json compatible
5 years ago
Erez Shinan
244f671665
Small refactor
5 years ago
Erez Shinan
335206911d
Basic serialize/deserialize working!
5 years ago
Erez Shinan
120d5b9ffa
Mid work
5 years ago
Erez Shinan
bd75bf2dff
Refactor - callbacks are now {rule: callback}, instead of a Callback object referenced by Rule.alias
5 years ago
Erez Shinan
688c453456
Corrections
6 years ago
night199uk
80a09697fe
Rebuild the way Earley prioritizes ambiguities
- Makes rule ordering the default ambiguity tie breaker.
E.g.
start: a | b
a: "A"
b: "A"
will return:
start
a
start: b | a
a: "A"
b: "A"
will return
start
b
- Replaces the ambiguity='resolve__antiscore_sum' with a separate option: 'priority'.
The priority option has 4 values: 'auto', 'none', 'normal', 'invert'.
'Auto' maps to 'Normal' for CYK and Earley and 'None' for LALR.
'None' filters your priorities and ignores them. This saves some extra tree walking on Earley.
'Normal' uses your priorities untouched, mimicing the old behaviour.
'Invert' negates your priorities, emulating the old 'resolve__antiscore_sum' behaviour.
This allows you to use priority logic even when ambiguity=='explicit', to get a better idea
of the shape of your tree; and to easily disable priorities without removing them from the
grammar for testing (or performance).
- ambiguity='explicit' now correctly returns an ambiguous tree again, as 0.6 did.
6 years ago
evandrocoan
6c013b9a1d
Fix misspelling on lark/lark.py documentation
6 years ago
Erez Shinan
222df5bab4
New Feature: Added maybe_placeholders option (Issue #285 )
6 years ago
Erez Shinan
6290b1647d
Lark now works under Python -OO (Issue #283 )
6 years ago
Jan Rydzewski
3ef84318b1
Removed unused imports and variables
6 years ago
night199uk
1d5fd7301a
Heavy modifications to the Earley parser to try and make it handle more
types of ambiguity.
- Rewritten along the lines of Elizabeth Scott's parser.
https://www.sciencedirect.com/science/article/pii/S1571066108001497
- Implement SPPF trees per Elizabeth Scott and Bram van der Sanden's work.
http://www.bramvandersanden.com/post/2014/06/shared-packed-parse-forest/
6 years ago
evandrocoan
6fc2f5a6ba
Fix #231
6 years ago
Erez Shinan
cffd610e77
Fixed reconstructor. All tests passing
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
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
c0cf1b3176
Added some docstrings, removed is_terminal from common
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
4a7a66d773
.lark (preparing)
6 years ago
Erez Shinan
209a3fe8fd
Interface improvements for the Lark instance
6 years ago
Erez Shinan
25c3c51b1c
Fixed bug in Earley: A tree builder optimization clashed with explicit ambiguity
6 years ago
Erez Shinan
22e525f53e
Fixed propagate positions. Added lexer_callbacks option.
7 years ago
Ehud Tamir
7c253b9372
Merge CYK parser.
7 years ago
Erez Shinan
da1910f5b6
More refactoring towards standalone
7 years ago
Erez Shinan
07b5469e86
More refactoring, untangling grammar compilation and parse-tree creation
7 years ago
Erez Shinan
1cc4c965e8
Big Refactor: Grammars now build in half the time. Code shorter & cleaner.
7 years ago
Erez Shinan
5748920df4
BUGFIX in xearley + Feature: earley__predict_all
7 years ago
Erez Shinan
c93140386d
BUGFIX: The Earley parser collected repeating derivations, and filtered them out much later than needed. This resulted in very long lists and many unnecessary comparisons.
7 years ago
Erez Shinan
b3cb2f433b
Towards an introspectable tree-builder
7 years ago
Erez Shinan
19a9c9c206
Towards an introspectable tree-builder. Also added tests.
7 years ago
Erez Shinan
aede340449
Added earley__all_derivations due to performance concerns
7 years ago