[][src]Crate nom_supreme

A collection of excellent utilities for nom, including:

  • ParserExt, a trait which makes available many common nom parser combinators as postfix methods, to complement those already available on nom::Parser.
  • ErrorTree, a nom error which retains as much information and context as possible about the details of the failed parse, with an excellent indenting formatter for printing these failures. Integrates with the extra error features of nom-supreme.
  • Improved tag parsers, which attach the mismatched the error in the event of a parse failure, similar to char.
  • parse_separated_terminated, the perfected folding parser for building parse loops.
  • final_parser, which serves as a bridge between nom-style IResult parsers and more typical rust results. It decorates a nom parser, requiring it to parse all of its input, not return Incomplete. It also uses an ExtractContext trait to convert the error locations in nom errors, which are usually just suffixes of the input, into more useful locations, such as a line and column number.

Modules

error

Additional error types designed to retain as much information as possible during a parse failure, making full use of the ParseError trait.

final_parser

Entry point layer into nom parsers. See final_parser for details.

multi

Additional parser combinators for running subparsers in a loop. Generally designed to try to provide more useful errors by being aware of a terminal condition.

parser_ext

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

tag

Enhanced tag parser for nom.

Functions

parse_from_str

A nom parser that parses any FromStr type. It uses a recognizer to parse the prefix string that should be parsed via FromStr.