forked from qt-creator/qt-creator
Pretty printing of wide string literals.
This commit is contained in:
@@ -1006,10 +1006,13 @@ bool PrettyPrinter::visit(SizeofExpressionAST *ast)
|
||||
|
||||
bool PrettyPrinter::visit(StringLiteralAST *ast)
|
||||
{
|
||||
out << '"' << spell(ast->token) << '"';
|
||||
if (ast->next) {
|
||||
out << ' ';
|
||||
accept(ast->next);
|
||||
for (StringLiteralAST *it = ast; it; it = it->next) {
|
||||
if (tokenKind(ast->token) == T_STRING_LITERAL)
|
||||
out << '"' << spell(ast->token) << '"';
|
||||
else
|
||||
out << "L\"" << spell(ast->token) << '"';
|
||||
if (it->next)
|
||||
out << ' ';
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -43,6 +43,8 @@ class Class {
|
||||
default:
|
||||
return 2;
|
||||
}
|
||||
s = L"ci\"aa\"ao" L"blah!";
|
||||
s2 = "ciao \"ciao\" ciao";
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user