diff --git a/src/lib/syntax/lexer.rs b/src/lib/syntax/lexer.rs index 696510a4bb..a9066a2176 100644 --- a/src/lib/syntax/lexer.rs +++ b/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 { let mut buf = String::new(); - loop { + while self.preview_next().is_some() { let ch = self.next()?; match ch { _ if ch.is_ascii_control() => {