zen_parser/lexer/
codes.rs1#[macro_export]
2macro_rules! is_token_type {
3 ($str: expr, "space") => {
4 matches!($str, ' ')
5 };
6 ($str: expr, "quote") => {
7 matches!($str, '\'' | '"')
8 };
9 ($str: expr, "digit") => {
10 matches!($str, '0'..='9')
11 };
12 ($str: expr, "bracket") => {
13 matches!($str, '(' | ')' | '[' | ']')
14 };
15 ($str: expr, "cmp_operator") => {
16 matches!($str, '>' | '<' | '!' | '=')
17 };
18 ($str: expr, "operator") => {
19 matches!($str, '#' | ',' | '?' | ':' | '+' | '-' | '/' | '*' | '^' | '%')
20 };
21 ($str: expr, "alpha") => {
22 matches!($str, 'A'..='Z' | 'a'..='z' | '$' | '_')
23 };
24 ($str: expr, "alphanumeric") => {
25 matches!($str, 'A'..='Z' | 'a'..='z' | '0'..='9' | '$' | '_')
26 };
27}