4 releases
0.0.4 | Sep 24, 2024 |
---|---|
0.0.3 | May 16, 2024 |
0.0.2 | May 16, 2024 |
0.0.1 | May 10, 2024 |
#104 in Parser tooling
161 downloads per month
Used in shrimple
72KB
1.5K
SLoC
Zero-dependency library with no-std support for writing parsers in a concise functional style & with rich error-reporting.
Kinds of errors are distinguished via a user-defined Reason
type, which signals what did
a parser expect.
A ParsingError
can also have no reason, which will mean that the error is recoverable.
Some built-in parsers can have core::convert::Infallible
as their error reason,
which means that any error the parser may ever return is recoverable.
The distinction between recoverable & fatal errors is important for parsers that need to try multiple options.
Error reporting with precise location in the source is facilitated by
constructing a FullParsingError
with methods such as
Parser::with_full_error
, ParsingError::with_src_loc