Merge branch 'main' of https://github.com/jyelon/luprex into main

This commit is contained in:
2022-05-09 15:10:22 -04:00

View File

@@ -313,12 +313,13 @@ void quote_string(const eng::string &s, std::ostream *os) {
(*os) << c;
}
} else {
unsigned int value = ((unsigned char)c);
switch (c) {
case '\n': (*os) << "\\n"; break;
case '\t': (*os) << "\\t"; break;
case '\r': (*os) << "\\r"; break;
default:
(*os) << "\\" << std::setfill('0') << std::setw(3) << int(c);
(*os) << "\\" << std::setfill('0') << std::setw(3) << value;
break;
}
}