Skip to content

Commit

Permalink
[lexer: single-line-comment] Fix bug when single line comment is last…
Browse files Browse the repository at this point in the history
… line of file (boa-dev#228)
  • Loading branch information
croraf committed Jan 20, 2020
1 parent 1328f49 commit 496c8fe
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/lib/syntax/lexer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,11 @@ impl<'a> Lexer<'a> {
fn read_line(&mut self) -> Result<String, LexerError> {
let mut buf = String::new();
while self.preview_next().is_some() {
<<<<<<< HEAD
let ch = self.next();
=======
let ch = self.next()?;
>>>>>>> [lexer: single-line-comment] Fix bug when single line comment is last line of file (#228)
match ch {
_ if ch.is_ascii_control() => {
break;
Expand Down

0 comments on commit 496c8fe

Please sign in to comment.