1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
//! Zero-dependency library with no-std support for writing parsers in a concise functional style
//! & with rich error-reporting.
//!
//! The library's structure can be represented as the trinity of
//! - [`Input`]
//! - [`Pattern`]
//! All patterns live in the [`pattern`] module
//! - [`Parser`]
//! All parsers live in the [`parser`] module
//!
//! The basic form of a parser is
//!
//! ```rust,ignore
//! use shrimple_parser::{Input, ParsingResult};
//!
//! fn foo<In: Input>(input: In) -> ParsingResult<In, Foo, FooParseError> { ... }
//! ```
//!
//! If the parser is infallible, i.e. never returns an unrecoverable error, it's customary to make
//! it generic over the reason type, to make combining it easier.
//!
//! ```rust,ignore
//! fn foo<In: Input, Reason>(input: In) -> ParsingResult<In, Foo, Reason> { ... }
//! ```
//!
//! 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.
//!
//! 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`]
pub use ;
pub use LineColumnToLocationError;