diff options
author | John Hodge <tpg@ucc.asn.au> | 2017-03-11 23:46:07 +0800 |
---|---|---|
committer | John Hodge <tpg@ucc.asn.au> | 2017-03-11 23:46:07 +0800 |
commit | 7249b41f12e690cea8f3ae44223689934dbb1fd4 (patch) | |
tree | fcbc3ebd585566904622509d75f93175b17d5404 | |
parent | 9540cf3642abaf41c8d4c89eaee8a0d72f2dcf1d (diff) | |
download | mrust-7249b41f12e690cea8f3ae44223689934dbb1fd4.tar.gz |
Lex - Fix handling of escaped newlines
-rw-r--r-- | src/parse/lex.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
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: |