Erez Sh
3bee21051e
Reverted changes regarding EOF
преди 4 години
Erez Sh
dcc98241c1
Improved handling and performance of large grammars
преди 4 години
Erez Sh
9cc57abd8a
Added 'cache' option to Lark (Issue #479 )
преди 4 години
MegaIng1
1b5ffc0660
Added the ability to use templates as template arguments. Error reporting should still be horrible.
преди 4 години
MegaIng1
20a2f690ca
Correct behaviour of aliases for templates (attempt 2)
преди 4 години
MegaIng1
2daca647d4
Unified rules and templates
преди 4 години
MegaIng1
8bf5da697a
Added test for template imports and implemented them
преди 4 години
MegaIng1
0c1c48411d
Added test for recursive templates + implemented them
преди 4 години
MegaIng1
ed17512c3a
Corrected & Simplified test
преди 4 години
MegaIng1
926c98bd41
Renamed global_flags to g_regex_flags
преди 4 години
MegaIng1
732a835b53
Added template tests
преди 4 години
MegaIng1
3a97029853
Added global_flags option to Lark (+ test)
преди 4 години
Erez Sh
cf7479f186
Post-merge fixed for end_symbol, + two more tests (Issue #237 )
преди 4 години
Erez Sh
94dd3646d4
Extend comments in rules tests
преди 4 години
Erez Sh
ae691bf35e
Revert propagate_positions to be False by default, still not ready for prime-time
преди 4 години
Erez Sh
dcc9d46eef
Fixes to propagate_positions
преди 4 години
Erez Sh
e1a39c58d0
Refactored v_args & visitors to a better, more agile implementation
преди 4 години
Jussi Laasonen
2de7e34766
Open imported grammars with UTF-8 encoding
преди 4 години
Mike Roberts
ed3c131ca8
Allow comments in rule definitions
преди 4 години
Erez Shinan
1815bd7fbd
Support for token visitation in internal transformers, as an alternative mechanism for lexer_callbacks
преди 4 години
Erez Shinan
84f08a452f
propagate_positions & maybe_placeholders are now true by default, updated docs, tests & examples accordingly (Issue #449 , #451 )
преди 4 години
Erez Shinan
54b18e5961
Allow transformers to transform tokens (Issue #389 )
преди 5 години
Michael Heyvaert
c00f4448fa
fix custom lexer handling for lalr parser + test
преди 5 години
Erez Shinan
c5c763580e
Fixed test for newline detection
преди 5 години
Fábio Macêdo Mendes
e8c67839c2
Test if lexer correctly detects newlines
преди 5 години
Erez Shinan
e3cbd7aadc
Negative priority now allowed in rules and tokens. Updated docs about priority
преди 5 години
Erez Shinan
aa75d50bd5
End symbol working for lalr + fixed validation for undefined %ignore
преди 5 години
Erez Shinan
f1e844accd
Mid work. Not promising
преди 5 години
Erez Shinan
e79689dce7
Remove unused rules (Issue #384 )
преди 5 години
Erez Shinan
a9106df824
Corrected thee Transformer's whole_tree interface, for both internal and external use
преди 5 години
Mostafa Razavi
e5868415eb
Implement embedded in-place transformers. See #378 .
As discussed in issue #378 , when an embedded transformer (that is, one
passed to the Lark class using the transformer argument), is an
inplace transformer (either a subclass of Transformer_InPlace, or with
the @v_args(tree=True) decorator), the in-place transformer was not
working correctly and in-fact Lark used it like a normal non-in-place
transformer, expecting it to return the transformed value.
преди 5 години
Erez Shinan
c5cb79307b
Fixes for new standalone (Issue #349 )
преди 5 години
PJCampi
ccbaebdc6f
load_grammar now collects all imports to make before loading them to namespace
преди 5 години
PJCampi
b055bc6399
import_grammar now include base_path in recursive call to load_grammar
преди 5 години
PJCampi
4889013404
get_namespace_name now preserves leading underscore on relative import
преди 5 години
Erez Shinan
ae51402cc7
Added serializer test
преди 5 години
Erez Shinan
e16bb35576
Change maybe_placeholders: Apply to [a] and [a b c], but not a? or (a b)? or [_a _b _c]
преди 5 години
Rogdham
2f6b97cfd3
Allow renaming relative import rule
%import .local.foo -> bar
преди 5 години
Rogdham
9b22d41e49
Change namespace naming and aliasing for imports
The `.` character is invalid as a group name in regex, replacing by `__`.
The bug arose in `lexer._build_mres`.
преди 5 години
Rogdham
0485a8a5b1
Tests for import rename
%import common.NUMBER -> N
%import .local.NUMBER -> N
преди 5 години
Erez Shinan
532c955962
Fixed tests to work with pytest, improved docs
преди 5 години
Kyungdahm Yun
d5c9006f01
Fix literal range escape assertion
преди 5 години
Erez Shinan
6b2df208c2
Fixed support for hex encoding (\xAA)
преди 5 години
Kyungdahm Yun
70d724732d
Support hex escape (\xhh) in string literal
преди 5 години
Erez Shinan
d2f55fe3ba
BUGFIX: Fixed common.ESCAPED_STRING (Issue #309 )
преди 5 години
Erez Shinan
f8486a02b0
Minor cleanup
преди 5 години
Erez Shinan
899f69a94b
Temporarily silence test_earley3 and test_earley4 (priority in terminals)
преди 5 години
Erez Shinan
688c453456
Corrections
преди 5 години
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.
преди 5 години
night199uk
72118eaf8c
Disable some debug that crept in
преди 5 години