Parses the given input
starting from the given index
Parses the given input
starting from the given index
The string we want to parse
The index in the string to start from. By default parsing starts from the beginning of a string, but you can start from halfway through the string if you want.
Whether or not you want a full trace of any error messages
that appear. Without it, you only get the single deepest
parser in the call-stack when it failed, and its index. With
trace
, you get every parser all the way to the top, though
this comes with a ~20-40% slowdown.
Whether or not this parser should show up when Failure.trace is called
A single, self-contained, immutable parser. The primary method is
parse
, which returns a T on success and a stack trace on failure.Some small optimizations are performed in-line: collapsing parsers.Combinators.Either cells into large ones and collapsing parsers.Combinators.Sequence cells into parsers.Combinators.Sequence.Flats. These optimizations together appear to make things faster but any 10%, whether or not you activate tracing
Collapsed, Trace Timings all true 87 /97 /94 all false 112/111/104 either true 89 /84 /81 either false 97 /102/97 none true 84 /79 /80 none false 96 /99 /97