[clang-tidy] use raw strings for easier readability (#882)

Found with modernize-raw-string-literal

Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
Rosen Penev
2020-06-15 13:29:38 -07:00
committed by GitHub
parent f05947ae59
commit 4f6d0733c9
2 changed files with 6 additions and 6 deletions

View File

@@ -366,15 +366,15 @@ bool WriteChar(ostream_wrapper& out, char ch) {
if (('a' <= ch && ch <= 'z') || ('A' <= ch && ch <= 'Z')) { if (('a' <= ch && ch <= 'z') || ('A' <= ch && ch <= 'Z')) {
out << ch; out << ch;
} else if (ch == '\"') { } else if (ch == '\"') {
out << "\"\\\"\""; out << R"("\"")";
} else if (ch == '\t') { } else if (ch == '\t') {
out << "\"\\t\""; out << R"("\t")";
} else if (ch == '\n') { } else if (ch == '\n') {
out << "\"\\n\""; out << R"("\n")";
} else if (ch == '\b') { } else if (ch == '\b') {
out << "\"\\b\""; out << R"("\b")";
} else if (ch == '\\') { } else if (ch == '\\') {
out << "\"\\\\\""; out << R"("\\")";
} else if (0x20 <= ch && ch <= 0x7e) { } else if (0x20 <= ch && ch <= 0x7e) {
out << "\"" << ch << "\""; out << "\"" << ch << "\"";
} else { } else {

View File

@@ -105,7 +105,7 @@ std::string Escape(Stream& in) {
case 'e': case 'e':
return "\x1B"; return "\x1B";
case ' ': case ' ':
return "\x20"; return R"( )";
case '\"': case '\"':
return "\""; return "\"";
case '\'': case '\'':