nom_supreme

Module parser_ext

Source
Expand description

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

Structs§

  • Parser which returns an error if the subparser didn’t consume the whole input.
  • Parser which parses an array by running a subparser in a loop a fixed number of times.
  • Parser which returns an error if the subparser returned Incomplete.
  • Parser which attaches additional context to any errors returned by the subparser.
  • Parser which returns a Failure if the subparser returned an error. This prevents other branches from being tried.
  • 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.
  • Parser which parses something via FromStr, using a subparser as a recognizer for the string to pass to from_str. Returns Err::Failure if the FromStr parse fails.
  • Parser which parses something via FromStr, using a subparser as a recognizer for the string to pass to from_str.
  • 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.
  • 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 failure.
  • Parser which returns failure if the subparser succeeds, and succeeds if the subparser fails.
  • Parser which wraps the subparser output in an Option, and returns a successful None output if it fails.
  • Parser which gets an optional output from a prefix subparser before running the main subparser. Returns the output even if the prefix subparser returns error.
  • Parser which runs a subparser but doesn’t consume any input
  • 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.
  • Parser which, when successful, discards the output of the subparser and instead returns the consumed input.
  • Parser wrapping a mutable reference to a subparser.
  • Parser which replaces errors coming from the inner parser.
  • Parser which parses an array by running a subparser in a loop a fixed number of times, parsing a separator between each item.
  • Parser which gets and discards an output from a second subparser, returning the output from the original parser if both were successful.
  • Parser which, when successful, discards the output of the subparser and instead returns a clone of a value.
  • Parser which checks the output of its subparser against a verifier function.
  • Parser which, when successful, returns the result of the inner parser and also the consumed input

Traits§

  • 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.