Module gchemol_parser::parsers
source · Expand description
Selected and extra winnow parser combinators
Re-exports§
pub use rest_line as read_until_eol;
pub use self::signed_integer as signed_digit;
pub use self::unsigned_integer as unsigned_digit;
Traits§
- Core trait for parsing
- Marks the input as being the complete buffer or a partial buffer for streaming input
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'
- Transforms an
ErrMode::Backtrack
(recoverable) toErrMode::Cut
(unrecoverable) - Sequence three parsers, only returning the output of the second.
- Recognizes zero or more ASCII numerical characters:
'0'..='9'
- Recognizes one or more ASCII numerical characters:
'0'..='9'
- Parse a f64 float number
- Recognizes an end of line (both
"\n"
and"\r\n"
). - Take and consuming to
literal
. - Take until found
literal
. Theliteral
will not be consumed. - Create context label
- Recognizes an end of line (both
"\n"
and"\r\n"
). - Anything except whitespace, this parser will not consume “\n” character
- Convert winnow error to anyhow Error with
input
context - Convert a string to a float.
- Sequence two parsers, only returning the output from the second.
- Parse a line containing a float number possibly surrounded by spaces
- Parse a line containing many float numbers
- Read a new line including eol (\n) or consume the rest if there is no eol char.
- Parse a line containing an unsigned integer number.
- Parse a line containing many unsigned numbers
- Recognize one or more decimal digits, optionally preceded by sign
Accumulate
the output of a parser into a container, likeVec
- Return the remaining input.
- Take the rest line. The line ending is not included.
- Parse a normal float number. The D format code for scientific (exponential) notation is also supported.
Accumulate
the output of a parser, interleaved withsep
- Match one signed integer: -123 or +123
- Keep reading lines until the innner parser produces a result
- Recognizes zero or more spaces and tabs.
- Recognizes zero or more spaces and tabs.
- Sequence two parsers, only returning the output of the first.
- 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 ofinner
. - Consume three float numbers separated by one or more spaces. Return xyz array.
Type Aliases§
- For use with
Parser::parse_peek
which allows the input stream to be threaded through a parser. - For use with
Parser::parse_next