Visitar URL original
fixed #63 - fails to parse raw string R"""(abc)""" · dummyunit/simplecpp@1cc1e40 · GitHub
Skip to content

Commit 1cc1e40

Browse files
committed
fixed cppcheck-opensource#63 - fails to parse raw string R"""(abc)"""
1 parent 9bb27c9 commit 1cc1e40

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

‎simplecpp.cpp‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -504,11 +504,11 @@ void simplecpp::TokenList::readfile(std::istream &istr, const std::string &filen
504504
if (ch == '\"' && cback() && cback()->op == 'R') {
505505
std::string delim;
506506
ch = readChar(istr,bom);
507-
while (istr.good() && ch != '(' && ch != '\"' && ch != '\n') {
507+
while (istr.good() && ch != '(' && ch != '\n') {
508508
delim += ch;
509509
ch = readChar(istr,bom);
510510
}
511-
if (!istr.good() || ch == '\"' || ch == '\n')
511+
if (!istr.good() || ch == '\n')
512512
// TODO report
513513
return;
514514
currentToken = '\"';

‎test.cpp‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1024,6 +1024,7 @@ void readfile_rawstring()
10241024
ASSERT_EQUALS("A = \"\"", readfile("A = R\"()\""));
10251025
ASSERT_EQUALS("A = \"\\\\\"", readfile("A = R\"(\\)\""));
10261026
ASSERT_EQUALS("A = \"\\\"\"", readfile("A = R\"(\")\""));
1027+
ASSERT_EQUALS("A = \"abc\"", readfile("A = R\"\"\"(abc)\"\"\""));
10271028
}
10281029

10291030
void stringify1()

0 commit comments

Comments
 (0)