Fix bug where the entire iterator would be eaten by a comment

This commit is contained in:
ConnorSkees 2020-01-06 18:45:41 -05:00
parent 5688e03b8a
commit bcfd809c92

View File

@ -150,7 +150,7 @@ impl<'a> Lexer<'a> {
self.pos.next_char(); self.pos.next_char();
match self.buf.peek().expect("expected something after '/'") { match self.buf.peek().expect("expected something after '/'") {
'/' => { '/' => {
self.buf.by_ref().skip_while(|x| x != &'\n').count(); self.buf.by_ref().take_while(|x| x != &'\n').for_each(drop);
} }
'*' => { '*' => {
while let Some(tok) = self.buf.next() { while let Some(tok) = self.buf.next() {