Rogdham
2f6b97cfd3
Allow renaming relative import rule
%import .local.foo -> bar
6 years ago
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`.
6 years ago
Kyungdahm Yun
d5c9006f01
Fix literal range escape assertion
6 years ago
Aurelien Grenotton
cbafa4d7bb
Make VisitError inherit from LarkError
The recently added VisitError is the only lark exception not inheriting from LarkError,
which makes it painful to catch for client application.
6 years ago
Erez Shinan
18c7022b0f
Borrowed tokens now copy end_line/end_column too
6 years ago
Erez Shinan
6b2df208c2
Fixed support for hex encoding (\xAA)
6 years ago
Kyungdahm Yun
70d724732d
Support hex escape (\xhh) in string literal
6 years ago
Erez Shinan
d1fea12aa5
Remove duplicates of empty rules (Issue #315 )
6 years ago
Erez Shinan
1b5f734c49
Bugfix: Callbacks now work for terminals with UnlessCallback (Issue #317 )
6 years ago
Erez Shinan
6a6dd97c52
VisitError now allows explicit access to previous exception (Issue #314 )
6 years ago
Erez Shinan
145d8a8e7c
Don't compile unused terminals (mentioned in issue #309 )
6 years ago
Erez Shinan
12a0cbae0c
Correction for commit b83bac4
(Issue #316 )
6 years ago
Erez Shinan
b83bac48bd
BUGFIX: Indenter was in corrupt state when parse failed (Issue #316 )
6 years ago
Erez Shinan
d2f55fe3ba
BUGFIX: Fixed common.ESCAPED_STRING (Issue #309 )
6 years ago
Erez Shinan
f8486a02b0
Minor cleanup
6 years ago
Erez Shinan
13ddc43782
Version bump
6 years ago
Erez Shinan
c4f8483c09
Small fix
6 years ago
Erez Shinan
688c453456
Corrections
6 years ago
Erez Shinan
934a997f83
Clean up
6 years ago
Erez Shinan
862a853340
More cleanup of Earley duplication
6 years ago
Erez Sh
4de71293e5
More cleanup
6 years ago
Erez Sh
57a602758d
Merged part of Earley & XEarley implementation. Major reduction
6 years ago
Erez Shinan
65d3212bed
Temporarily disable leo transitives
6 years ago
Erez Shinan
8e7c05a8f6
Added VisitError for transformers
6 years ago
Erez Shinan
00510edee6
Added a nicer error for duplicate rules
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
night199uk
a543eeb162
Fix assert on empty options for a Rule
6 years ago
night199uk
64992aa49c
Fix a performance regression on Rules related to empties
6 years ago
evandrocoan
6c013b9a1d
Fix misspelling on lark/lark.py documentation
6 years ago
night199uk
80964e903b
Simplify the way we create Leo sets
Avoids recursion and improves performance slightly
6 years ago
night199uk
d74781605d
Fix Ambiguous Expander problems with nested ambiguities
6 years ago
night199uk
ea536820a5
Fix propogate positions for Earley
6 years ago
night199uk
1f5abfc937
Fix Propagate Positions
6 years ago
evandrocoan
48351c3d3e
Trimmed whitespaces and ensured a new line on the end of the file
6 years ago
Erez Shinan
467483553b
Fixed placeholder code, should work as expected (Issue #285 )
6 years ago
Erez Shinan
adb30180aa
maybe_placeholder now doesn't apply to anonymous terminals
6 years ago
Erez Shinan
641fec43ce
@v_args at function level now takes precedent over class level
6 years ago
Erez Shinan
222df5bab4
New Feature: Added maybe_placeholders option (Issue #285 )
6 years ago
Erez Shinan
76e185a36c
Added the Forest interface for explicit ambiguity
6 years ago
night199uk
04d90fa916
Implement Joop Leo's optimizations for right recursion performance
6 years ago
night199uk
637f121109
Cleanup unused Derivation
6 years ago
night199uk
8fa8ac36fc
Remove Earley Column
We can replace Earley Columns with basic python sets
for improved performance and simplicity.
6 years ago
night199uk
8415fa26a3
Add a pydot visualizer for the SPPF.
6 years ago
night199uk
bb22c84df3
Speed up repetitive parsing using the same parser
When using the same parser repeatedly for small parsers we incur
significant overhead by recreating the ForestVisitor each parser.
We can cache the Forest walker and re-use it by making it stateless.
Also, we can use slots for all of the Forest Walkers to reduce
construction delay and function call overhead.
6 years ago
Erez Shinan
6290b1647d
Lark now works under Python -OO (Issue #283 )
6 years ago
Erez Shinan
5c68bf677a
Implement eq/hash for Rule (Issue #278 )
6 years ago
Erez Shinan
c172653ea6
Fix issue with propagate_positions
6 years ago
Erez Shinan
b2489e13e2
A few fixes (tests + interface)
6 years ago
Erez Shinan
0935543280
Fix issue with propagate_positions
6 years ago
Erez Shinan
74fc559ea5
Reconstructor fixes
6 years ago