lark/lark-stubs/exceptions.pyi

43 lines
648 B
Python
Raw Normal View History

2020-02-13 14:34:05 +00:00
# -*- coding: utf-8 -*-
from typing import Dict, Iterable, Callable
from .tree import Tree
class LarkError(Exception):
pass
class GrammarError(LarkError):
pass
class ParseError(LarkError):
pass
class LexError(LarkError):
pass
class UnexpectedInput(LarkError):
pos_in_stream: int
def get_context(self, text: str, span: int = 40):
...
def match_examples(
self,
parse_fn: Callable[[str], Tree],
examples: Dict[str, Iterable[str]]
):
...
class UnexpectedToken(ParseError, UnexpectedInput):
pass
class UnexpectedCharacters(LexError, UnexpectedInput):
pass