Uses the specified message if the original Parser fails.
Apply the original parser, but only succeed if o
also succeeds.
Apply the original parser, but only succeed if o
also succeeds.
Note that o
does not need to consume the same amount of input to satisfy this condition.
Apply the original Parser zero or more times and provide the (potentially empty) sequence of results.
Apply the original Parser one or more times and provide the non-empty sequence of results.
Produces a Parser that applies the original Parser and then applies next
(in order), discarding the result of next
.
Produces a Parser that applies the original Parser and then applies next
(in order), discarding the result of next
.
(The arrow point in the direction of the retained result.)
Apply the original Parser zero or one times, returning None if it was applied zero times or the result wrapped in Some if it was applied once.
Apply the original Parser, but provide alt
as the result if it fails.
Apply the original Parser, but provide value
as the result if it succeeds.
Applied both the original parser and b
on the same input and returns the results produced by each parser
the source of examples when displaying completions to the user.
limits the number of examples that the source of examples should return. This can prevent lengthy pauses and avoids bad interactive user experience.
indicates whether completion examples should be checked for validity (against the given parser). Invalid examples will be filtered out and only valid suggestions will be displayed.
a new parser with a new source of completions.
Explicitly defines the completions for the original Parser.
Explicitly defines the completions for the original Parser.
If an exception is thrown by the original Parser, capture it and fail locally instead of allowing the exception to propagate up and terminate parsing.
Produces a Parser that filters the original parser.
Produces a Parser that filters the original parser.
If 'f' is not true when applied to the output of the original parser, the Parser returned by this method fails.
The failure message is constructed by applying msg
to the String that was successfully parsed by the original parser.
Applies the original parser, applies f
to the result to get the next parser, and applies that parser and uses its result for the overall result.
Returns the original parser.
Returns the original parser. This is useful for converting literals to Parsers.
For example, 'c'.id
or "asdf".id
Apply the original Parser to the input and then apply f
to the result.
Converts a Parser returning a Char sequence to a Parser returning a String.
Apply either the original Parser or b
.
Apply either the original Parser or b
.
Apply the original Parser and then apply next
(in order).
Apply the original Parser and then apply next
(in order). The result of both is provides as a pair.
Produces a Parser that applies the original Parser and then applies next
(in order), discarding the result of the original parser.
Produces a Parser that applies the original Parser and then applies next
(in order), discarding the result of the original parser.
(The arrow point in the direction of the retained result.)
(Since version 0.12.2) Use and
and not
and explicitly provide the failure message
(Since version 0.12.2) Use not
and explicitly provide the failure message
the source of examples when displaying completions to the user.
a new parser with a new source of completions. It displays at most 25 completion examples and does not remove invalid examples.