def parse(self, source: Sequence[Input]) -> Result[Output]:
"""Abstract method for completely parsing a source.
While ``parse`` is a method on every parser for convenience, it
is really a function of the context. It is the duty of the context
to set the correct ``Reader`` to use and to handle whitespace
not handled by the parsers themselves. This method is pulled from the
context when the parser is initialized.
Args:
source: What will be parsed.
Returns:
If the parser succeeded in matching and consumed the entire output,
the value from ``Continue`` is copied to make a ``Success``. If the
parser failed in matching, the error message is copied to a
``Failure``. If the parser succeeded but the source was not
completelt consumed, a ``Failure`` with a message indicating this
is returned.
"""
raise NotImplementedError()
评论列表
文章目录