lisbeth_error/
lib.rs

1//! Lisbeth-error
2//!
3//! A dead-simple error type for the lisbeth parser infrastructure.
4//!
5//! The types in this crate *should* be used in that order:
6//!   - an [`ErrorReporter`] is created from input,
7//!   - a [`SpannedStr`] is created from the [`ErrorReporter`],
8//!   - parsing happens on that [`SpannedStr`],
9//!   - tokens are produced, they store their position with a [`Span`],
10//!   - when an error occurs, an error is reported with an [`AnnotatedError`],
11//!   - this error is formatted by the [`ErrorReporter`] declared previously,
12//!   which returns a [`FormattedError`],
13//!   - the [`FormattedError`] is printed on the console.
14//!
15//! An example of usage can be found in the [handbook] module.
16//!
17//! [`ErrorReporter`]: reporter::ErrorReporter
18//! [`SpannedStr`]: span::SpannedStr
19//! [`Span`]: span::Span
20//! [`AnnotatedError`]: error::AnnotatedError
21//! [`FormattedError`]: reporter::FormattedError
22
23#![forbid(missing_docs, warnings)]
24
25pub mod error;
26pub mod handbook;
27pub mod reporter;
28pub mod span;