Commit e24c1ff6 authored by Eckhart Arnold's avatar Eckhart Arnold
Browse files

- dead code removal

parent 3fbcf6cd
......@@ -92,43 +92,6 @@ MAX_DROPOUTS = 3 # type: int
# stop trying to recover parsing after so many errors
class ParserError(Exception):
"""
A `ParserError` is thrown for those parser errors that allow the
controlled re-entrance of the parsion process after the error occured.
If a reentry-rule has been configured for the parser where the error
occured, the parser guard can resume the parsing process.
Currently, the only case when a `ParserError` is thrown (and not some
different kind of error like `UnknownParserError`, is when a `Series`-
detects a missing mandatory element.
"""
def __init__(self,
parser: ParserBase,
node: Node,
remaining: StringView,
error: Error):
self.parser = parser # type: Parser
self.node = node # type: Node
self.remaining = remaining # type: StringView
self.error = error # type: Error
@property
def location(self):
return self.parser.grammar.document_length__ - len(self.remaining)
# to be continued...
# class ReentryRule:
# """
# A rule for reentering the parsing process after a ParserError was thrown.
# """
# def __init__(self, parser: ParserBase, fast_forward_re: str):
# self.parser = parser # type: List[Parser]
# self.rules = # type: Sequence[Tuple[str, str]]
def add_parser_guard(parser_func):
"""
Add a wrapper function to a parser functions (i.e. Parser.__call__ method)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment