[][src]Module combine::parser::choice

Combinators which take one or more parsers and attempts to parse successfully with at least one of them.

Structs

Choice
Optional
Or

Traits

ChoiceParser

ChoiceParser represents a parser which may parse one of several different choices depending on the input.

Functions

choice

Takes a tuple, a slice or an array of parsers and tries to apply them each in order. Fails if all the parsers fails or if an applied parser consumes input before failing.

optional

Parses parser and outputs Some(value) if it succeeds, None if it fails without consuming any input. Fails if parser fails after having consumed some input.

or

Equivalent to p1.or(p2).