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
Rob Rose
5a6e604560
Added .gitignore for pyenv
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
Rob Rose
836735211f
Resolved upstream changes to use new file-extension
- @erezsh added the new Lark reference and some other things using the
current .g extension, so I wanted to resolve them for PR #117
- Renamed lark.g to lark.lark.
- Changed lark_grammar.py to use .lark file extensions.
- Changed urls that used .g to use .lark.
6 years ago
Rob Rose
f92ed2607e
Merge branch 'master' of https://github.com/lark-parser/lark into file-ext-change
- Merging updated upstream into branch for file extension changes.
- Will push so Pull Request has no remaining conflicts.
- Also will change the file type of lark example grammar.
6 years ago
Erez Shinan
0a40137ac7
Update README.md
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
Erez Shinan
594a271a4e
Merge pull request #133 from Gentle/interpreter_defaults
Interpreter class: fixed default behavior to return results
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
Erez Shinan
4c89d69d97
Update README.md
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
599b80e30a
Added example for error reporting with LALR
6 years ago
Erez Shinan
d46318c725
Merge branch 'pr_accept' (Containing #129 with corrections)
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
Erez Shinan
b22268db6f
Merge pull request #128 from psboyce/patch-2
Fix order of members when pickling Token
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
04c0b04add
Improvements based on the PR of @drslump ( https://github.com/erezsh/lark/pull/125 )
Mostly improvements to memory consumption.
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
Erez Shinan
ba0dc789a3
Significantly better memory performance (Thanks @drslump!)
Added __slots__ to RulePtr and Token, resulting in significantly lower memory consumption.
As suggested by @drslump .
6 years ago
Erez Shinan
eb6e809ffc
Version bump
6 years ago
Erez Shinan
4f2330fc9b
Fixed bug in Earley prioritization
6 years ago
Erez Shinan
25c3c51b1c
Fixed bug in Earley: A tree builder optimization clashed with explicit ambiguity
6 years ago
Erez Shinan
255ef0d973
Added error message for the alias syntax in terminals (Issue #97 )
7 years ago
Rob Rose
ff588714c1
Changed Lark standalone file extension
- Reasoning addressed in Issue #116
- Renamed example and grammars file to use new extension.
- Changed `.g` to new extension of `.lrk` in places where it is
referenced.
7 years ago
Erez Shinan
1c57445fdc
Merge pull request #104 from night199uk/token_pickle
Ensure Tokens can be pickled correctly
7 years ago
night199uk
7be2c04637
Ensure Tokens can be pickled correctly
7 years ago
Erez Shinan
d210087cb5
Updated setup.py. How long has it been saying 'Alpha'? Hmm..
7 years ago
Erez Shinan
bc159cd364
Merge pull request #88 from cclauss/patch-2
Python 3.2 and 3.3 are End of Life
7 years ago
Erez Shinan
eba4a604cb
Added tests for standalone generator
7 years ago
Erez Shinan
d77f93c818
Standalone generator working again. Updated examples
7 years ago
Erez Shinan
52d4ce2990
Merge pull request #102 from night199uk/functools
Allow functools partials to be used with the InlineTransformer
7 years ago
Erez Shinan
3eebd4ad4b
Version bump
7 years ago
Erez Shinan
327cca8c00
Added 'considered_rules' to exceptions, to help users debug
7 years ago