justlex 0.1.0

Configurable lexer with no dependencies
Documentation
// 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

mod justlex;

pub use justlex::*;