MegaIng1
2eb5c746ff
Removed safe_cache option
3 years ago
Erez Sh
22c289126f
Rename ParserPuppet -> InteractiveParser
3 years ago
Erez Sh
2a1b03bc65
Rename ParserPuppet -> InteractiveParser
3 years ago
MegaIng1
0f4ca60d83
Added support for verifying imported files
3 years ago
MegaIng1
704e7552bd
Added support for atomicwrites
3 years ago
MegaIng1
754f08a622
Added get_puppet, helpers and tests
3 years ago
MegaIng1
2e46211fd6
A few updates to stubs ( fix #856 )
3 years ago
Erez Sh
e759718c3d
Added pyi
3 years ago
Erez Sh
7ce0f7015f
Added load_grammar.find_grammar_errors
3 years ago
MegaIng1
7f795e8271
Fix for #826 (Thanks @mikeiovine ) + stubs + tests
3 years ago
Erez Sh
1d61de4f94
Fix .pyi files
3 years ago
MegaIng1
02035aa141
Added example + Corrected python3.lark
3 years ago
MegaIng1
8b4f874d3d
added example grammar_building.py
3 years ago
MegaIng1
5db3003edb
Updated stubs
3 years ago
Erez Sh
a7c71f32cc
Fixed Lark.lex(), added dont_ignore option, added tests for it.
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
MegaIng1
8ec6d0f2ab
Correction for PR
- `user_repr` is now a method
- Fix for python 2.7
- excepts -> expected
4 years ago
Erez Sh
7beb681563
Adds stubs; cleanup
4 years ago
MegaIng1
4e442bc0b8
regression-fix for #760
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 Sh
5b30ba4841
Cleanup, and a few PEP8 changes
4 years ago
Fabio Zadrozny
661eca61f4
Change typing in lark.pyi: Any -> UnexpectedInput
4 years ago
Fabio Zadrozny
5735d29f42
Add on_error to parse lark.pyi
4 years ago
Fabio Zadrozny
6d4b0c9676
Fix lark.pyi stub syntax
4 years ago
MegaIng1
dcde0bcbe9
Prevent terminals from being filtered out when used in always_accept
4 years ago
MegaIng1
5f7a5d428a
renamed `source_code` -> `source_grammar`
4 years ago
MegaIng1
a4260110ff
added PackageResource
4 years ago
MegaIng1
f7d466dc7d
added PackageResource
4 years ago
MegaIng1
a50fc10773
import_paths->sources, source->source_path, various implementation changes
4 years ago
MegaIng1
009cc10590
Added `FromPackageLoader` and `open_from_package`
4 years ago
MegaIng1
53b3e12bba
Added `import_sources`
4 years ago
Erez Sh
62776b9908
Added type information for UnexpectedEOF (Issue #686 )
4 years ago
Erez Sh
02d57bc32a
Small adjustments to PR
4 years ago
MegaIng1
cb2d9cded0
Refactored ParserPuppet, added stubs
4 years ago
MegaIng1
a7bcd0bc2d
Added `accepts` attribute to `UnexpectedToken` and update stubs
4 years ago
MegaIng1
28e0a86f38
Small improvements for debug info
4 years ago
MegaIng1
c93106f143
Tests for bytes parser (credit to @ctrlcctrlv )
4 years ago
MegaIng1
0c89189b5f
Support for bytes parser
4 years ago
Inky
fcaf10ac4d
Fixes caching when custom lexers are used
4 years ago
MegaIng1
e4e29f5127
Added a bit of explanation for `term_subs`
4 years ago
Inky
a379f7fc22
Added cache option for Lark stub
4 years ago
julienmalard
09e80a5c9e
Fixed tests
4 years ago
julienmalard
e22536fc9b
Updated stubs
4 years ago
julienmalard
86a162d6d8
Added `regex` module as optional mode.
4 years ago
Erez Sh
f04a2167d6
Fixes to mypy stubs (Issue #561 )
4 years ago
Erez Sh
7538c93080
Fixed for mypy (including issue #532 )
4 years ago
nic
97975532ac
Fix lexer_callback arg in stub for Lark constructor
4 years ago