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
//! A simple, fast, intuitive parser combinator framework for Rust.
//!
//! # Get Started
//!
//! ```
//! use whitehole::{
//! combinator::eat,
//! parser::Parser,
//! };
//!
//! // define the kind of the output
//! #[derive(Debug, Clone, PartialEq, Eq)]
//! enum Kind {
//! A,
//! }
//!
//! let mut parser = Parser::builder() // create a parser builder
//! .entry(eat("a").bind(Kind::A)) // set the entry action
//! .build("a"); // build the parser with the input
//!
//! let output = parser.next().unwrap(); // yield the next output
//! assert_eq!(output.value, Kind::A); // check the output
//! ```
//!
//! See the [`combinator`] module to learn how to compose the entry action.
//! See the [`parser`] module to learn how to use the parser.
//!
//! # Read the Source Code
//!
//! Here is the recommended order to read the source code:
//!
//! - [`digest`]
//! - [`instant`]
//! - [`action`]
//! - [`combinator`]
//! - [`parser`]