The failure case of Parsed
containing an error message and the remaining input.
Implementation note:
The message property is of type Message
, to allow for lazy message creation.
The former SDK parser combinators which this API is partially inspired by contained
a lot of unnecessary string concatenations for messages which were then never read.
This implementation avoids this extra cost and the result is measurable
(about 15% performance gain for a typical Markdown document for example).
- Value parameters:
- maxOffset
The offset position the parser could successfully read to before failing
- msgProvider
A provider that produces an error message for this failure based on its SourceCursor
- next
The unconsumed input at the point where the failing parser started
- Companion:
- object
Value members
Concrete methods
Inherited methods
Returns the result value from the parser invocation if the parser succeeded or otherwise the specified fallback value.
Returns the result value from the parser invocation if the parser succeeded or otherwise the specified fallback value.
- Inherited from:
- Parsed
Indicates whether this results represents an unsuccessful parser invocation.
Indicates whether this results represents an unsuccessful parser invocation.
- Inherited from:
- Parsed