Commit Graph

64 Commits

Author SHA1 Message Date
Erez Shinan de808ddd73 Typing: Added more type annotations 2023-10-02 23:55:19 +03:00
Erez Shinan 975b3f3eaf Added strict-mode, enabled using the strict=True flag 2023-03-09 12:05:16 +01:00
Patrick Lannigan 074c55b769 Remove redefinitions related to standalone parser
* Use a dictionary to look up valid parser creators
* Split parsing frontend argument validatoin from parsing frontend creation
* Convert MakeParsingFrontend uses into functions
2022-02-16 09:04:48 -05:00
Erez Sh 1457e01e7e Fixes to typing and tests 2021-08-17 11:01:40 +03:00
Erez Sh 7719984298 Merge branch 'v1.0' into 1.0b 2021-08-17 10:26:55 +03:00
Erez Sh 9c975d932c Merge branch 'master' into 1.0a 2021-07-15 17:10:26 +03:00
Erez Sh 7cb8acbe54 Bugfix for deepcopy + small unrelated refactor (issue #938) 2021-07-15 17:00:51 +03:00
Chanic Panic 804114d1ff Remove default values on type declarations and mark ClassVars 2021-06-30 13:21:09 -07:00
Chanic Panic 4bc9445238 Corrections for PR and some mypy errors 2021-06-30 12:49:14 -07:00
Chanic Panic 433adeeaff Last batch of .pyi files
__init__, lexer, and parsers/__init__
2021-06-29 13:08:32 -07:00
Erez Sh eb45324146 Removed deprecated code 2021-06-27 23:42:57 +03:00
Erez Sh aa7dc19bc3 Corrections for PR 2020-11-29 13:29:51 +02:00
MegaIng1 8ec6d0f2ab Correction for PR
- `user_repr` is now a method
- Fix for python 2.7
- excepts -> expected
2020-11-29 13:29:24 +02:00
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
2020-11-27 12:49:54 +01:00
Erez Sh 679c415673 Small refactor to adjust PR 2020-11-26 17:24:40 +02:00
Erez Sh 284dfe7fd3 Refactored parser_frontends. Now significantly simpler 2020-11-25 19:01:18 +02:00
Erez Sh 5b30ba4841 Cleanup, and a few PEP8 changes 2020-11-12 11:09:16 +02:00
MegaIng1 605b91e4be improve error message with token source.
rename LexerConf.terminals to LexerConf.tokens
Make Exception message generation lazy
Made a few classes new-style
2020-10-20 22:29:56 +02:00
Blank Spruce 96873d64ba Make transformer work with tokens in standalone parser, fixes #648 2020-08-13 18:19:25 +02:00
MegaIng1 0c89189b5f Support for bytes parser 2020-07-29 19:49:34 +02:00
Erez Sh 7dc00179e6 Lark now loads faster
- Refactored lexer interface into LexerConf
- Lexer now compiles regexps only when used (especially useful for ContextualLexer)
- Lexer now doesn't validate on deserialize (noticable speedup)
2020-07-02 12:44:02 +03:00
MegaIng1 926c98bd41 Renamed global_flags to g_regex_flags 2020-03-27 12:40:47 +01:00
MegaIng1 3a97029853 Added global_flags option to Lark (+ test) 2020-03-26 23:56:44 +01:00
Erez Shinan f1e844accd Mid work. Not promising 2019-07-01 17:07:23 +03:00
Erez Shinan a798dec779 Fix to new serializer code (Discussed in issue #349) 2019-04-18 14:36:39 +03:00
Erez Shinan bd75bf2dff Refactor - callbacks are now {rule: callback}, instead of a Callback object referenced by Rule.alias 2019-03-30 17:42:21 +03:00
Erez Shinan c85098e090 Small refactoring in standalone 2018-09-10 21:22:54 +03:00
Erez Shinan f048bfb870 Refactoring around terminals / tokens 2018-09-10 17:36:43 +03:00
Erez Shinan dd69b95338 Cleanup after pylint 2018-08-03 04:52:19 +03:00
Erez Shinan 5c6df8e825 Moved and restructured exceptions
* All exceptions are now under exceptions.py
* UnexpectedInput is now superclass of UnexpectedToken and UnexpectedCharacters,
  all of which support the get_context() and match_examples() methods.
2018-06-18 15:14:31 +03:00
Erez Shinan c0cf1b3176 Added some docstrings, removed is_terminal from common 2018-06-18 11:57:53 +03:00
Erez Shinan 880f42dd12 Corrections to PR and added get_context 2018-04-18 12:33:47 +03:00
DrSlump e69d567bce example driven parser errors 2018-04-18 11:25:13 +03:00
Erez Shinan 327cca8c00 Added 'considered_rules' to exceptions, to help users debug 2018-03-08 23:23:00 +02:00
Erez Shinan 07f45a0bd3 Style fixes 2018-02-10 12:37:34 +02:00
Erez Shinan 22e525f53e Fixed propagate positions. Added lexer_callbacks option. 2018-01-28 15:42:40 +02:00
Erez Shinan 37c1c0f65f Better error message for bad regexps (Issue #62) 2018-01-17 00:05:24 +02:00
Erez Shinan 9b0672fda6 Standalone tools now supports postlex 2018-01-10 10:28:25 +02:00
Erez Shinan da1910f5b6 More refactoring towards standalone 2018-01-10 00:50:41 +02:00
Erez Shinan 1cc4c965e8 Big Refactor: Grammars now build in half the time. Code shorter & cleaner. 2018-01-07 00:54:31 +02:00
Erez Shinan 5f5acca40b Cleaned up the LALR(1) parser 2017-12-24 20:52:10 +02:00
Erez Shinan dcb7297c30 Flags are now part of the terminal identity 2017-11-20 13:01:07 +02:00
Erez Shinan 2efbc08854 Support for multiple flags 2017-11-16 09:47:46 +02:00
Erez Shinan e8810e3b80 Fixed some deprecation warnings due to changes in Py3.6 regexps 2017-10-30 11:14:42 +02:00
Erez Shinan ac9ea26b58 Added token priority for standard lexers.
Big Thanks to Seth G of the mappyfile project for financing this feature!
2017-08-22 17:47:22 +03:00
Erez Shinan 0c5acaab8a Refactoring load_grammar 2017-08-04 22:46:20 +03:00
Erez Shinan 0d5dd2bd0d Improved README. Dynamic lexer now generates tokens. 2017-08-04 16:55:24 +03:00
Erez Shinan 4eec924403 Added prioritization to Earley. Use rule.1 etc. Highest priority will be selected in case of ambiguity. 2017-08-04 02:42:31 +03:00
Erez Shinan 188386cf04 Fixed main bug in test_token_collision2. 2017-07-26 10:18:50 +03:00
Erez Shinan 794a1c4965 More flags work 2017-03-09 21:33:34 +02:00