bump simplecpp (#2245)

This commit is contained in:
Rikard Falkeborn 2019-10-08 10:38:22 +02:00 committed by Daniel Marjamäki
parent 93e9e12aa1
commit d27e70db8e
1 changed files with 14 additions and 6 deletions

View File

@ -1133,12 +1133,20 @@ std::string simplecpp::TokenList::readUntil(std::istream &istr, const Location &
backslash = false; backslash = false;
ret += ch; ret += ch;
if (ch == '\\') { if (ch == '\\') {
const char next = readChar(istr, bom); bool update_ch = false;
char next = 0;
do {
next = readChar(istr, bom);
if (next == '\r' || next == '\n') { if (next == '\r' || next == '\n') {
ret.erase(ret.size()-1U); ret.erase(ret.size()-1U);
backslash = (next == '\r'); backslash = (next == '\r');
} update_ch = false;
} else if (next == '\\')
update_ch = !update_ch;
ret += next; ret += next;
} while (next == '\\');
if (update_ch)
ch = next;
} }
} }