Check for EOF ("\0") when reading comments
This commit is contained in:
parent
b2f7afef07
commit
953870fae0
1 changed files with 4 additions and 0 deletions
|
@ -136,6 +136,10 @@ impl Lexer {
|
|||
self.handle_newline();
|
||||
*token = Some(Token::Comment(self.value()));
|
||||
}
|
||||
else if c.is_eof() {
|
||||
*token = Some(Token::Comment(self.value()));
|
||||
}
|
||||
self.advance();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue