Module combinators
Source - Collection
- collect
- Parses as many
p
as possible until EOF is reached, collecting them into a
C
. Fails if p
every fails. C
may be empty. - collect_some
- Parses as many
p
as possible until EOF is reached, collecting them into a
C
. Fails if p
ever fails. C
is not allowed to be empty. - delimited_collect
- Parses many
separator
delimited p
s, the entire collection of which must
start with start
and end with end
. item
Gramatically, this is: - last_of_many
- Parses
p
until p
fails, returning the last successful p
. - ok
- Parses
p
, returning Some
if it succeeds and None
if it fails. Discards
the error message. - prefixed_series
- Parses many
separator
delimited p
s that are collectively prefixed with
prefix
. Gramatically, this is: - series
- Parses many
separator
delimited p
s. Gramatically, this is: - succeeds
- Parses
p
, returning true
if it succeeds and false
if it fails.
Discards the error message. - surrounded
- Skips all tokens that match
f
before and after a p
, returning p
. - trailing_series
- Parses many
separator
delimited p
s with an optional trailing separator.
Gramatically, this is: - try_collect
- Parses as many
p
as possible until EOF is reached or p
fails, collecting
them into a C
. C
may be empty.