mirror of
https://github.com/iritmaximus/compilers.git
synced 2026-10-12 19:13:35 +03:00
remove unused lexer
This commit is contained in:
@@ -1 +0,0 @@
|
||||
pub fn lexer() {}
|
||||
@@ -1,4 +1,4 @@
|
||||
pub mod lexer;
|
||||
pub mod parser;
|
||||
pub mod tokenizer;
|
||||
|
||||
pub fn compile(code: &str) -> &str {
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
use crate::compiler::tokenizer::Token;
|
||||
|
||||
pub fn parser(tokens: Vec<Token>) {}
|
||||
@@ -9,6 +9,7 @@ const MULTICHAR_OPERATOR_STR: &str = r"([<>=!]=?)";
|
||||
const NUMBER_LITERAL_STR: &str = r"([0-9]+)";
|
||||
const IDENTIFIER_STR: &str = r"([a-zA-Z_][a-zA-Z_0-9]*)";
|
||||
|
||||
// TODO: implement the whole tokenizer without regex
|
||||
lazy_static! {
|
||||
// Damn, regex...
|
||||
static ref TOKEN_RE: Regex = Regex::new(format!(r#"{WHITESPACE_REGEX_STR}|{COMMENT_REGEX_STR}|{PUNCTUATION_STR}|{SINGLE_CHAR_OPERATOR_STR}|{MULTICHAR_OPERATOR_STR}|{NUMBER_LITERAL_STR}|{IDENTIFIER_STR}"#).as_str()).unwrap();
|
||||
|
||||
Reference in New Issue
Block a user