refactor tokenizers away from one giant switch statement
This commit is contained in:
parent
3cf8ef02d1
commit
a257beb170
14 changed files with 366 additions and 8 deletions
|
@ -3,6 +3,7 @@ use lazy_static::lazy_static;
|
|||
use std::collections::HashMap;
|
||||
|
||||
lazy_static! {
|
||||
/// Mapping of reserved keywords to their respective TokenType.
|
||||
pub static ref KEYWORDS: HashMap<std::string::String, TokenType> = {
|
||||
let mut m = HashMap::new();
|
||||
m.insert("and".into(), And);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue