Handler
Value members
Concrete methods
For debug/testing purposes,
this combines the unfinished
and finished
collections
in an array with each entry at its corresponding index,
representing unfinished parsers as Rights and finished results as Lefts.
Also, since Applicative / product builds things up from right to left,
the parsers at the "end" end up having the lowest number indexes,
so we reverse the output so each parser/result is located at the
index corresponding to that parser's position in the source that constructed this parser.
For debug/testing purposes,
this combines the unfinished
and finished
collections
in an array with each entry at its corresponding index,
representing unfinished parsers as Rights and finished results as Lefts.
Also, since Applicative / product builds things up from right to left,
the parsers at the "end" end up having the lowest number indexes,
so we reverse the output so each parser/result is located at the
index corresponding to that parser's position in the source that constructed this parser.
Inherited methods
Wraps this handler as a "top level" handler, which will inject a SpacTraceElement
(representing the current input or the "EOF" signal)
to any exception is thrown by this handler when calling its step
or finish
methods.
Wraps this handler as a "top level" handler, which will inject a SpacTraceElement
(representing the current input or the "EOF" signal)
to any exception is thrown by this handler when calling its step
or finish
methods.
Used internally by Parser
's parse
methods.
- Inherited from:
- Handler
Convenience function to call step
on a sequence of inputs all at once.
If the step
returns a result, this method will return a Left
containing that result and the remainder of the inputs
that were not consumed.
If the inputs
run out before the handler returns a result from a step
, this method will return a Right
containing the latest state of the handler.
This method will not call the handler's finish()
.
Convenience function to call step
on a sequence of inputs all at once.
If the step
returns a result, this method will return a Left
containing that result and the remainder of the inputs
that were not consumed.
If the inputs
run out before the handler returns a result from a step
, this method will return a Right
containing the latest state of the handler.
This method will not call the handler's finish()
.
In general, you won't call this method directly. Instead, use one of the Parser trait's parse
methods.
- Type parameters:
- C
An
Unconsable
collection, i.e.List
orcats.data.Chain
- In2
Subtype of
In
, orIn
(to satisfy contravariance)
- Value parameters:
- C
Evidence that the
inputs
has ahead/tail
split operation- inputs
A sequence of inputs
- Returns:
Either the handler's result paired with the remaining inputs, or the new handler state
- Inherited from:
- Handler