lark/lark-stubs/exceptions.pyi

48 lines
710 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
2020-02-16 06:09:53 +00:00
def get_context(self, text: str, span: int = ...):
2020-02-13 14:34:05 +00:00
...
def match_examples(
self,
parse_fn: Callable[[str], Tree],
examples: Dict[str, Iterable[str]]
):
...
class UnexpectedToken(ParseError, UnexpectedInput):
pass
class UnexpectedCharacters(LexError, UnexpectedInput):
2020-02-16 06:09:53 +00:00
line: int
column: int
class VisitError(LarkError):
2020-02-13 14:34:05 +00:00
pass