Module combine::parser::combinator [] [src]

Various combinators which do not fit anywhere else.

Structs

AndThen
AnyPartialState
AnyPartialStateParser
AnySendPartialState
AnySendPartialStateParser
FlatMap
Ignore
Lazy
LookAhead
Map
NoPartial
NotFollowedBy
Recognize
Try

Functions

and_then

Equivalent to p.and_then(f).

any_partial_state

Returns a parser where P::PartialState is boxed. Useful as a way to avoid writing the type since it can get very large after combining a few parsers.

any_send_partial_state

Returns a parser where P::PartialState is boxed. Useful as a way to avoid writing the type since it can get very large after combining a few parsers.

flat_map

Equivalent to p.flat_map(f).

lazy

Constructs the parser lazily and on each parse_* call. Can be used to effectively reduce the size of deeply nested parsers as only the function producing the parser is stored in Lazy

look_ahead

look_ahead(p) acts as p but doesn't consume input on success.

map

Equivalent to p.map(f).

no_partial
not_followed_by

Succeeds only if parser fails. Never consumes any input.

recognize

Constructs a parser which returns the tokens parsed by parser accumulated in F: Extend<P::Input::Item> instead of P::Output.

try

try(p) behaves as p except it acts as if the parser hadn't consumed any input if p fails after consuming input.