Actually read the value of the token variable

This commit is contained in:
Eryn Wells 2017-04-03 16:19:58 -04:00
parent cc1a87761d
commit 33bf65db68

View file

@ -529,7 +529,7 @@ impl Iterator for Lexer {
}
let mut token: Option<Token> = None;
println!("Lexing '{}'", &self.input[self.begin ..]);
loop {
while token.is_none() {
let c = match self.input.char_at(self.forward) {
Some(c) => c,
None => '\0',
@ -556,7 +556,6 @@ impl Iterator for Lexer {
assert!(result.has_token() || self.forward != previous_forward, "No lexing progress made!");
if result.has_token() {
token = result.ok().unwrap();
break;
}
else if result.is_err() {
assert!(false, "{}", result.err().unwrap());