1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
extern crate regex;

mod token_definition;
pub use token_definition::*;

mod flexer;

pub use flexer::*;

mod tokens;

pub use tokens::*;

#[macro_export]
macro_rules! flexer {
    (
        $( $name:expr => $regex:expr => $conv:expr )*
    ) => {
        $crate::Flexer::new(vec![
            $( $crate::TokenDefinition::new($name, $regex, Box::new( $conv )), )*
        ])
    };
}