Created
March 13, 2018 23:59
-
-
Save rust-play/521d6823f163d98cf9d3be57b8a37361 to your computer and use it in GitHub Desktop.
Code shared from the Rust Playground
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use lexer::lex_token; | |
use lexer::lexer_parts::literal_lexer; | |
use constants::TokenTypes; | |
use constants::operations::OPARRAY; | |
use constants::delimiters::SEMICOLON; | |
use constants::datatypes::DATATYPESARRAY; | |
use constants::reserved_constants::RESERVEDCONSTANTSARRAY; | |
use lexer::lexer_parts::data_type_lexer; | |
use lexer::lexer_parts::op_token_lexer; | |
use lexer::lexer_parts::end_token_lexer; | |
use constants::command::COMMANDSARRAY; | |
pub fn is_token_command(vect_token: &String) -> bool { | |
let mut is_token_command: bool = false; | |
for command_token in COMMANDSARRAY { | |
if (vect_token == command_token) { | |
//println!("{}", reserved_word); | |
is_token_command = true; | |
} | |
} | |
return is_token_command; | |
} | |
pub fn lex_valid_comand_token(vect_token: &String) -> String { | |
let mut valid_command_token: String = String::from(""); | |
for command_token in COMMANDSARRAY { | |
if command_token == &vect_token { | |
valid_command_token = command_token.to_string(); | |
return valid_command_token; | |
} | |
} | |
return valid_command_token; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment