Crate microparsec

Source

Macros§

parsers

Structs§

AnyParser
Parses for any of the supplied parsers and returns the first successful result, or an error if no parser matched.
BetweenParser
Between parser
Context
Parser context
ExactParser
Attempts to parse a specified number of chars or to the EOI and fails otherwise
ExpectParser
Runs a supplied parser, if fails, returns a custom error message
Failure
Failure is a failed parse result
FloatParser
Parses for a float
ForgetParser
“Forgets” the success value type and changes it to ()
IntegerParser
Parses for an integer
LettersParser
Parses for at least one letter
ManyParser
Parses as many times as possible, returns an error if no parsing was successful
MapParser
Maps the result of a parser to a new value
OptionalParser
Tries to parse the given parser, but if it fails, it returns a successful result with a None value
RegexParser
Parses for a given regex pattern
SequenceParser
Parses for a sequence of parsers
SpacesParser
Parses for at least one and as many spaces as possible
StringParser
Parses for a specific target string
Success
Success is a successful parse result
SurelyParser
If an any parser comes across a surely parser and it fails the any parser immediately fails as well

Enums§

ParserType
The types of parsers
Pos
Enum used to determine the relative position to parse to in the exact parser

Traits§

ContextParserT
Trait for parsers that can take in a Context and act on it.
Parsers are understood to be pure with static state after initialization. This is important because AnyParser, SequenceParser and likewise parsers store parsers internally as ParserRc<dyn ContextParserT<T>> and thus only make a shallow copy. Parsers that are not pure might and likely will cause unexpected behaviour.
StringParserT
This is a sub-trait of ContextParserT<T>. It’s only function is to abstract away the creation of an initial Context for parsing and acts as “syntax sugar”.

Type Aliases§

ParserRc