Erez Shinan
a798dec779
Fix to new serializer code (Discussed in issue #349 )
6 years ago
Erez Shinan
c5cb79307b
Fixes for new standalone (Issue #349 )
6 years ago
PJCampi
ccbaebdc6f
load_grammar now collects all imports to make before loading them to namespace
6 years ago
PJCampi
b055bc6399
import_grammar now include base_path in recursive call to load_grammar
6 years ago
PJCampi
4889013404
get_namespace_name now preserves leading underscore on relative import
6 years ago
Erez Shinan
5ab12b031c
Added transformer, postlex arguments to standalone
6 years ago
Erez Shinan
ae51402cc7
Added serializer test
6 years ago
Erez Shinan
475312c608
Bugfix in tools.nearley: Added support for null keyword (Issue #342 )
6 years ago
Erez Shinan
20329e0bf5
Bugfix in tools.nearley: Backslash now handled correctly in strings (Issue #341 )
6 years ago
Peter Dolak
b89b003cdb
Fix v_args when used on classes with non-callable members
6 years ago
Erez Shinan
2b3fabd01c
Fixed Discard, broken in 0.6.6 (Issue #337 )
6 years ago
Erez Shinan
e16bb35576
Change maybe_placeholders: Apply to [a] and [a b c], but not a? or (a b)? or [_a _b _c]
6 years ago
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
Rogdham
0485a8a5b1
Tests for import rename
%import common.NUMBER -> N
%import .local.NUMBER -> N
6 years ago
Erez Shinan
532c955962
Fixed tests to work with pytest, improved docs
6 years ago
Kyungdahm Yun
d5c9006f01
Fix literal range escape assertion
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
d2f55fe3ba
BUGFIX: Fixed common.ESCAPED_STRING (Issue #309 )
6 years ago
Erez Shinan
f8486a02b0
Minor cleanup
6 years ago
Erez Shinan
899f69a94b
Temporarily silence test_earley3 and test_earley4 (priority in terminals)
6 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
night199uk
72118eaf8c
Disable some debug that crept in
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
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
b2489e13e2
A few fixes (tests + interface)
7 years ago
Erez Shinan
0077366255
Earley now ignores infinite recursion
7 years ago
Erez Shinan
74fc559ea5
Reconstructor fixes
7 years ago
Alexey Shrub
f604b73a3c
Tree walk tests
7 years ago
Erez Shinan
1798971455
Adjustments
7 years ago
Erez Shinan
216c341b06
Fixed v_args handling of staticmethod and classmethod (Issue #246 , #249 )
7 years ago
Erez Shinan
6c8ba76b79
Fixed a deep bug in grammar analysis involving empty rules (Issue #250 )
7 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/
7 years ago
Erez Shinan
720372a386
Standalone parser now uses contextual lexer instead of traditional one (Issue #212 )
It should be easy to allow the user to choose between them, but perhaps unnecessary, as the one and only benefit of the traditional parser is a tiny performance advantage.
7 years ago
Erez Shinan
242ac24ea6
Fixed the propagate_positions implementation, and added start_pos/end_pos attributes to Tree.Meta
Related to issue #216
7 years ago
Erez Shinan
181f061091
BUGFIX - Fixed 2 issues with line counting
1) Failed to detect newlines in regexps of the form [^...]
2) Last token didn't get end_line & end_column
7 years ago
Erez Shinan
32b78b8ee5
BUGFIX: Repeated use of optional rules tripped up the simplifier, manifesting when aliases were used (Issue #197 )
7 years ago
Erez Shinan
cffd610e77
Fixed reconstructor. All tests passing
7 years ago
Julien Malard
92b50c39cd
Tests for reconstructors
7 years ago
Erez Shinan
454c88b58a
Refactoring and fixes for merge 2fd0087
7 years ago
Julien Malard
a03e01bc12
Fixed test.
7 years ago
Julien Malard
12004b3c65
Reimplemented relative and multiple imports.
7 years ago
Julien Malard
405f6a399d
From and relative type imports seem to work.
7 years ago