match_string

Macro match_string 

Source
macro_rules! match_string {
    ($string:expr, $token_type:ty, $token_value:expr, $rule_name:ident) => { ... };
}
Expand description

Creates a lexer rule that matches a specific string.

ยงUsage

use runic_kit::lexer::utils::match_string;

match_string!("let", String, "let".to_string(), LetRule); // `"let"` is the string to match, `String` is the type of the token, `"let".to_string()` is the token value, and `LetRule` is the name of the rule.