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
// SPDX-License-Identifier: MIT
//!
//! # justlex.rs
//!
//! Configurable lexer with no dependencies.
//!
//! The entire implementation lives in a single `.rs` file. This means
//! that you can copy-paste it in your project and modify it as you
//! like, keeping your dependency tree clean. You can easily add
//! custom [`Punct`]uation or [`Keyword`]s by modifying the file
//! directly.
//!
//! Check out the examples in the `examples` directory.
//!
//! # Quickstart
//!
//! ```
//! use justlex::*;
//!
//! // Some input string
//! let example_input = String::from(
//! "#include <stdio.h>
//! if (a == 17*2 + 35) { // single line comment
//! /* multi
//! * line
//! * comment
//! */
//! return b;
//! }\n");
//!
//! // Setup the lexer
//! let mut lexer = JustLex::default();
//! lexer.set_input(example_input);
//!
//! // Iterate over the tokens
//! for token in lexer {
//! let token = token;
//! println!("Received token {:?}", token);
//! if token == Token::None {
//! break;
//! }
//! }
//! ```
//!
//! # Credits
//!
//! - Author: Giovanni Santini
//! - Mail: giovanni.santini@proton.me
//! - Github: @San7o
//! - License: MIT
pub use *;