This repo contains code to mirror other repos. It also contains the code that is getting mirrored.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
648 B

  1. # -*- coding: utf-8 -*-
  2. from typing import Dict, Iterable, Callable
  3. from .tree import Tree
  4. class LarkError(Exception):
  5. pass
  6. class GrammarError(LarkError):
  7. pass
  8. class ParseError(LarkError):
  9. pass
  10. class LexError(LarkError):
  11. pass
  12. class UnexpectedInput(LarkError):
  13. pos_in_stream: int
  14. def get_context(self, text: str, span: int = 40):
  15. ...
  16. def match_examples(
  17. self,
  18. parse_fn: Callable[[str], Tree],
  19. examples: Dict[str, Iterable[str]]
  20. ):
  21. ...
  22. class UnexpectedToken(ParseError, UnexpectedInput):
  23. pass
  24. class UnexpectedCharacters(LexError, UnexpectedInput):
  25. pass