Fix hang in tokenizing for <<IMAGINARY_UNIT>>

This commit is contained in:
Tiffany Bennett 2016-08-13 20:09:51 -04:00
parent 74e4510e43
commit dddf6f6177

View file

@ -210,7 +210,7 @@ impl<'a> Iterator for TokenIterator<'a> {
},
'<' => {
let mut string = "<IMAGINARY_UNIT>>".chars();
while self.0.next() == string.next() {}
while self.0.peek().is_some() && self.0.next() == string.next() {}
if string.next() == None {
Token::ImaginaryUnit
} else {