added booleans, variable updates and function execution
This commit is contained in:
parent
28c440539d
commit
b074f18648
4 changed files with 51 additions and 3 deletions
|
@ -124,7 +124,7 @@ fn read_identifier(splitted: &Vec<&str>, pos: &mut usize, out: &mut Vec<Token>)
|
|||
identifier += char;
|
||||
}
|
||||
//Lets break it up to tokens
|
||||
let words: Vec<&str> = identifier.split(" ").collect();
|
||||
let words: Vec<&str> = identifier.trim().split(" ").collect();
|
||||
let mut state: Vec<&str> = vec![];
|
||||
let mut state_pos: usize = 0;
|
||||
let mut i = 0;
|
||||
|
@ -159,7 +159,9 @@ fn read_identifier(splitted: &Vec<&str>, pos: &mut usize, out: &mut Vec<Token>)
|
|||
}
|
||||
i += 1;
|
||||
}
|
||||
pre_out.push(Token { typ: TokenType::IDENTIFIER, value: state.join(" "), pos: state_pos });
|
||||
if state_pos > 0 {
|
||||
pre_out.push(Token { typ: TokenType::IDENTIFIER, value: state.join(" "), pos: state_pos });
|
||||
}
|
||||
//Check for invalid keywords!
|
||||
for token in &mut pre_out {
|
||||
if token.typ == TokenType::KEYWORD {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue