Module parser

Source
Expand description

Parser combinator library.

Macros§

literal_map
Macro to define a parser for one or more string literals, mapping the results.
parse_tree
Macro to define a custom parser using a match inspired parse tree syntax.

Structs§

ParserIterator
An iterator that lazily parses the input using the provided parser.
ParserMatchesIterator
An iterator which returns successful parse outputs only, skipping over errors.

Enums§

ParseError
Error type returned by Parser::parse.

Traits§

Parseable
Trait for types that have a canonical parser.
Parser
Parser trait.

Functions§

byte
Parser that consumes a single byte.
byte_range
Parser that consumes a single byte in the supplied range.
constant
Parser that consumes no input and always succeeds, returning the provided value.
eof
Parser which matches the end of the input.
eol
Parser which matches newlines or the end of the input.
i8
Parser for i8 values.
i16
Parser for i16 values.
i32
Parser for i32 values.
i64
Parser for i64 values.
i128
Parser for i128 values.
noop
Parser that consumes no input and always succeeds, returning ().
number_range
Parser for numbers in the supplied range.
one_of
Attempt to parse using a list of parsers.
take_while
Parser for substrings consisting of bytes matching the provided function.
take_while1
Parser for non-empty substrings consisting of bytes matching the provided function.
u8
Parser for u8 values.
u16
Parser for u16 values.
u32
Parser for u32 values.
u64
Parser for u64 values.
u128
Parser for u128 values.

Type Aliases§

ParseResult
Result type returned by Parser::parse.