Module gchemol_parser::parsers

source ·
Expand description

Selected nom parser combinators (complete version, no streaming)

Re-exports§

Modules§

  • non-streaming version parser combinators
  • streaming version parser combinators

Macros§

  • macro imported from nom 6
  • macro imported from nom 6

Traits§

  • Helper trait to convert a parser’s result to a more manageable type
  • Show nice parse trace on Error.

Functions§

  • Recognizes zero or more lowercase and uppercase ASCII alphabetic characters: a-z, A-Z
  • Recognizes one or more lowercase and uppercase ASCII alphabetic characters: a-z, A-Z
  • Recognizes zero or more ASCII numerical and alphabetic characters: 0-9, a-z, A-Z
  • Recognizes one or more ASCII numerical and alphabetic characters: 0-9, a-z, A-Z
  • Tests a list of parsers one by one until one succeeds.
  • Create a new error from an input position, a static string and an existing error. This is used mainly in the context combinator, to add user friendly information to errors when backtracking through a parse tree
  • Runs the embedded parser count times, gathering the results in a Vec
  • Matches an object from the first parser and discards it, then gets an object from the second parser, and finally matches an object from the third parser and discards it.
  • Recognizes zero or more ASCII numerical characters: 0-9
  • Recognizes one or more ASCII numerical characters: 0-9
  • Recognizes floating point number in text format and returns a f64.
  • Match line ending preceded with zero or more whitespace chracters
  • Returns the longest slice of the matches the pattern.
  • Parse till certain characters are met.
  • Take and consuming to token.
  • Repeats the embedded parser, gathering the results in a Vec.
  • Runs the embedded parser, gathering the results in a Vec.
  • Repeats the embedded parser m..=n times
  • Applies the parser f until the parser g produces a result.
  • Maps a function on the result of a parser.
  • Applies a function returning an Option over the result of a parser.
  • Applies a function returning a Result over the result of a parser.
  • Recognizes zero or more spaces, tabs, carriage returns and line feeds.
  • Recognizes one or more spaces, tabs, carriage returns and line feeds.
  • Succeeds if the child parser returns an error.
  • Anything except whitespace, this parser will not consume “\n” character
  • Recognizes one of the provided characters.
  • Optional parser, will return None on Err::Error.
  • Gets an object from the first parser, then gets another object from the second parser.
  • Creates an error from the input position.
  • Convert a string to a float.
  • Tries to apply its parser without consuming the input.
  • Matches an object from the first parser and discards it, then gets an object from the second parser.
  • Parse a line containing a float number
  • Parse a line containing many float numbers
  • Read a new line including eol (\n) or consume the rest if there is no eol char.
  • Read the remaining line. Return a line excluding eol.
  • Parse a line containing an unsigned integer number.
  • Parse a line containing many unsigned integers
  • Alternates between two parsers to produce a list of elements.
  • Alternates between two parsers to produce a list of elements until Err::Error.
  • Gets an object from the first parser, then matches an object from the sep_parser and discards it, then gets another object from the second parser.
  • Match one unsigned integer: -123 or +123
  • Recognizes zero or more spaces and tabs.
  • Recognizes one or more spaces and tabs.
  • Recognizes a pattern
  • Recognizes a case insensitive pattern.
  • Returns an input slice containing the first N input elements (Input[..N]).
  • Return and consume n elements from input string slice.
  • Returns the input slice up to the first occurrence of the pattern.
  • Gets an object from the first parser, then matches an object from the second parser and discards it.
  • Applies a tuple of parsers one by one and returns their results as a tuple. There is a maximum of 21 parsers
  • Match one unsigned integer: 123
  • A combinator that takes a parser inner and produces a parser that also consumes both leading and trailing whitespace, returning the output of inner.
  • Consume three float numbers separated by one or more spaces. Return xyz array.

Type Aliases§

  • parse result with verbose error