From 7249b41f12e690cea8f3ae44223689934dbb1fd4 Mon Sep 17 00:00:00 2001 From: John Hodge Date: Sat, 11 Mar 2017 23:46:07 +0800 Subject: Lex - Fix handling of escaped newlines --- src/parse/lex.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/parse/lex.cpp b/src/parse/lex.cpp index 4e5b4c2d..7b99c433 100644 --- a/src/parse/lex.cpp +++ b/src/parse/lex.cpp @@ -857,9 +857,13 @@ uint32_t Lexer::parseEscape(char enclosing) case '\n': while( ch.isspace() ) ch = this->getc(); - this->ungetc(); - if( ch == enclosing ) + if(ch == '\\' ) + return parseEscape(enclosing); + else if( ch == enclosing ) + { + this->ungetc(); return ~0; + } else return ch.v; default: -- cgit v1.2.3