Browse Source

[lexer: single-line-comment] Fix bug when single line comment is last line of file (#228)

pull/229/head
croraf 5 years ago committed by Jason Williams
parent
commit
ce9af33620
  1. 2
      src/lib/syntax/lexer.rs

2
src/lib/syntax/lexer.rs

@ -153,7 +153,7 @@ impl<'a> Lexer<'a> {
/// read_line attempts to read until the end of the line and returns the String object or a LexerError
fn read_line(&mut self) -> Result<String, LexerError> {
let mut buf = String::new();
loop {
while self.preview_next().is_some() {
let ch = self.next()?;
match ch {
_ if ch.is_ascii_control() => {

Loading…
Cancel
Save