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
#[macro_export]
macro_rules! is_token_type {
    ($str: expr, "space") => {
        matches!($str, ' ')
    };
    ($str: expr, "quote") => {
        matches!($str, '\'' | '"')
    };
    ($str: expr, "digit") => {
        matches!($str, '0'..='9')
    };
    ($str: expr, "bracket") => {
        matches!($str, '(' | ')' | '[' | ']')
    };
    ($str: expr, "cmp_operator") => {
        matches!($str, '>' | '<' | '!' | '=')
    };
    ($str: expr, "operator") => {
        matches!($str, '#' | ',' | '?' | ':' | '+' | '-' | '/' | '*' | '^' | '%')
    };
    ($str: expr, "alpha") => {
        matches!($str, 'A'..='Z' | 'a'..='z' | '$' | '_')
    };
    ($str: expr, "alphanumeric") => {
        matches!($str, 'A'..='Z' | 'a'..='z' | '0'..='9' | '$' | '_')
    };
}