Expand description
Addons for a nom parser.
-
A error code trait.
-
A richer error type ParserError.
-
A thin error type TokenizerError.
-
A tracking/logging system for the parser.
-
A simple framework to test parser functions.
-
Took some inspiration from nom_supreme and implemented a similar subset of postfix functions. They are integrated with the error Code and the error types of this crate.
-
SourceStr and SourceBytes to get context information around a Span. Can retrieve line/column information and context data without burdening every single span.
-
Uses LocatedSpan for debug builds and replaces with plan
&str
or&[u8]
for release builds. Tracking is compiled away completely for release builds.
Re-exports§
pub use crate::parser_error::ParserError;
pub use crate::token_error::TokenizerError;
Modules§
- combinators
- Provides some extra parser combinators.
- examples
- Types used in doc tests.
- parser_
error - Error type, nom::error::Error replacement.
- prelude
- Prelude for all traits.
- provider
- source
- spans
- Additions to LocatedSpan, str and [u8]
- test
- Test framework for parsers.
- token_
error - Second, simpler error type. Same size as nom::error::Error.
Macros§
- define_
span - Defines a type alias for the span type. Switches between ParseSpan<> in debug mode and plain type in release mode.
Structs§
- Track
- Central struct for tracking.
Traits§
- Code
- Parser error code.
- ErrInto
- Analog function for err_into() working on a parser, but working on the Result instead.
- ErrOr
NomErr - This trait is used for Track.err() where the function wants to accept both
E
andnom::Err<E>
. - KParse
Error - This trait catches the essentials for an error type within this library.
- KParser
- Adds some common parser combinators as postfix operators to parser.
- Track
Result - This is an extension trait for nom-Results.
- Tracked
Span - This trait is implemented for an input type. It takes a tracking event and its raw data, converts if necessary and sends it to the actual tracker.
Type Aliases§
- DynTrack
Provider - Standard input type. This is a LocatedSpan with a TrackProvider.
- Parse
Span - Parser
Result - ParserResult for ParserError. Equivalent to nom::IResult<(I, O), ParserError<C, I>>
- Tokenizer
Result - ParserResult for TokenizerError.
Equivalent to nom::IResult<(I, O), TokenizerError<C, I>>