Erez Shinan
0f2f3d71b5
Merge pull request #790 from unbrice/types
type stubs: A consistent type for `Token.value`
3 years ago
Erez Shinan
f628b7facd
Merge pull request #789 from unbrice/master
3 years ago
Brice Arnould
781ae59b3c
type stubs: A consistent type for `Token.value`
The Token's value is described as being a in the attribute list: 460a221923/lark-stubs/lexer.pyi (L84)
and as `Any` in `__init__` parameters: 460a221923/lark-stubs/lexer.pyi (L91)
Yet one of the recipes, [Use a transformer to parse integer tokens](https://github.com/lark-parser/lark/blob/master/docs/recipes.md#use-a-transformer-to-parse-integer-tokens ), recommends to set it to other types. So IIUC, `Any` is the correct one.
3 years ago
Brice Arnould
d390a9c0b1
type stubs: fix typo
3 years ago
Brice Arnould
b59764f898
type stubs: Allows `v_args` to decorate a class.
v_args is described as taking a callbable as argument: 36a7b050c1/lark-stubs/visitors.pyi (L75-L79)
Yet the documentation states it can decorate a class: 5b30ba4841/lark/visitors.py (L417-L418)
3 years ago
Erez Shinan
460a221923
Merge pull request #735 from fabioz/patch-2
4 years ago
Erez Sh
36a7b050c1
Merge branch 'MegaIng-better-terminals'
4 years ago
Erez Sh
aa7dc19bc3
Corrections for PR
4 years ago
MegaIng1
8ec6d0f2ab
Correction for PR
- `user_repr` is now a method
- Fix for python 2.7
- excepts -> expected
4 years ago
MegaIng1
17d4da7924
Merge branch 'master' of https://github.com/lark-parser/lark into better-terminals
Conflicts:
lark/common.py
lark/exceptions.py
lark/lexer.py
lark/load_grammar.py
lark/parser_frontends.py
4 years ago
Erez Sh
111738b8b9
Revised handling of ignored tokens in xearley (Issue #768 )
4 years ago
Erez Shinan
692a950488
Merge pull request #781 from lark-parser/refactor_frontends
Refactored parser_frontends. Now significantly simpler
4 years ago
Erez Sh
ed065eeb76
Removed duplicate line
4 years ago
Erez Sh
679c415673
Small refactor to adjust PR
4 years ago
Erez Sh
712df517b2
Fixes for PR. Custom lexer now works with CYK
4 years ago
Erez Shinan
a6e5af6b80
Merge pull request #782 from MegaIng/master
Fix tests failing when used with `python -m unittest discover`
4 years ago
MegaIng1
b655bd950a
Fix tests failing when used with `python -m unittest discover`
4 years ago
Erez Sh
284dfe7fd3
Refactored parser_frontends. Now significantly simpler
4 years ago
Erez Shinan
0cb7404ae3
Merge pull request #779 from lark-parser/refactor_exceptions
4 years ago
Erez Sh
7beb681563
Adds stubs; cleanup
4 years ago
Erez Sh
c6819a0ed7
Refactored all likely exceptions to inherit from LarkError, and improved error messages.
4 years ago
Erez Sh
071a35d1c0
Merge branch 'MegaIng-grammars-lark-lark'
4 years ago
Erez Sh
47316488dd
Merge branch 'grammars-lark-lark' of https://github.com/MegaIng/lark into MegaIng-grammars-lark-lark
4 years ago
Erez Shinan
8379d784ec
Merge pull request #776 from MegaIng/earley_custom
4 years ago
MegaIng1
83e896b3b8
Prevent test from running with old custom lexer
4 years ago
MegaIng1
26e03b9ff8
Merge branch 'master' of https://github.com/lark-parser/lark into earley_custom
Conflicts:
tests/test_parser.py
4 years ago
MegaIng1
cf9d0d915e
Fixes for custom lexer.
4 years ago
MegaIng1
cf25c06420
Added custom lexer to earley.
4 years ago
Erez Sh
e6dcc43478
Improve match_examples() for Earley (Issue #760 )
4 years ago
Erez Sh
70c233e301
Update links in pypi (Issue #714 )
4 years ago
Erez Shinan
b9bfdc926a
Merge pull request #772 from lark-parser/match_examples
4 years ago
Erez Sh
e6bbfd16c0
Fixed comment
4 years ago
Erez Sh
7fa993320e
match_examples() now works for Earley+Standard
Note: This refactor opens the door for implementing a ContextualLexer for Earley.
But unlike the existing one for LALR, it will have to be computed at runtime,
rather than ahead of time.
4 years ago
Erez Sh
1aff84391a
Added test for match_examples
4 years ago
Erez Sh
f285cda4f2
Earley error reporting - initial (Issue #760 )
4 years ago
Erez Sh
b3eb2a3120
Add token_history to UnexpectedToken
4 years ago
Erez Shinan
4e346431d9
Merge pull request #771 from MegaIng/fix-760
regression-fix for #760
4 years ago
MegaIng1
4e442bc0b8
regression-fix for #760
4 years ago
Erez Shinan
29c580f57b
Merge pull request #769 from ThatXliner/patch-1
4 years ago
MegaIng1
2fe5f2ed4c
Added tests for `lark.lark`
4 years ago
MegaIng1
dd3cf90b2d
Moved `lark.lark` into the standard library.
4 years ago
ThatXliner
2e06d4c000
Update README.md
Fixed pyparsing link to point to
https://github.com/pyparsing/pyparsing
4 years ago
ThatXliner
1fc0810086
Fix broken link in README
See https://gitter.im/lark-parser/Lobby?at=5fb83369771c185e0eb8c0e2
4 years ago
Erez Shinan
dc22f2218f
Merge pull request #767 from gward/lexer-stub
4 years ago
Greg Ward
68e5e86b5b
Add missing type hint for Token constructor
mypy thinks that Token's __init__ is inherited from __str__(). That's
not wrong -- it's just irrelevant, because Token also implements
__new__(). Token's _effective_ constructor signature is determined by
its __new__() method, so that's what I have used in the type hint.
Not clear if 'value' is supposed to be Any, but that's what I need in
my application. And it works just fine!
4 years ago
Greg Ward
11a0052eb5
Fix incorrect type hint for 'lexer' argument to Lark constructor
The code is crystal clear:
assert lexer in ('standard', ...) or issubclass(lexer, Lexer)
But the type hint said that lexer must be an _instance_ of Lexer, not
a subclass. This change fixes it to require a subclass of Lexer.
4 years ago
Erez Shinan
074a7c7e12
Merge pull request #766 from MegaIng/patch-3
Adding missing Testcase to `__main__`
4 years ago
MegaIng
a4ddb1e84f
Adding missing Testcase to `__main__`
4 years ago
Erez Sh
c715426f32
Version bump to 0.11.1
4 years ago
Erez Shinan
1a3df7909f
Merge pull request #755 from chanicpanic/fix-index-error
Fix IndexError
4 years ago