[][src]Module nom_supreme::parser_ext

Extensions to the nom Parser trait which add postfix versions of the common combinators. See ParserExt for details.

Structs

AllConsuming

Parser which returns an error if the subparser didn't consume the whole input.

Complete

Parser which returns an error if the subparser returned Incomplete.

Context

Parser which attaches additional context to any errors returned by the subparser.

Cut

Parser which returns a Failure if the subparser returned an error. This prevents other branches from being tried.

Delimited

Parser which gets and discards a delimiting value both before and after the main subparser. Returns the output from the main subparser if all were successful.

FromStrParser

Parser which parses something via FromStr, using a subparser as a recognizer for the string to pass to from_str.

MapRes

Parser which runs a fallible mapping function on the output of the subparser. Any errors returned by the mapping function are transformed into a parse error.

Not

Parser which returns failure if the subparser succeeds, and succeeds if the subparser fails.

Optional

Parser which wraps the subparser output in an Option, and returns a successful None output if it fails.

Peek

Parser which runs a subparser but doesn't consume any input

Preceded

Parser which gets and discards an output from a prefix subparser before running the main subparser. Returns the output from the main subparser if both were successful.

Recognize

Parser which, when successful, discards the output of the subparser and instead returns the consumed input.

RefParser

Parser wrapping a mutable reference to a subparser.

Terminated

Parser which gets and discards an output from a second subparser, returning the output from the original parser if both were successful.

Value

Parser which, when successful, discards the output of the subparser and instead returns a clone of a value.

Verify

Parser which checks the output of its subparser against a verifier function.

Traits

ParserExt

Additional postfix parser combinators, as a complement to Parser. Mostly these are postfix versions of the combinators in nom::combinator and nom::sequence, with some additional combinators original to nom-supreme.