Pretty printing of wide string literals.

This commit is contained in:
Roberto Raggi
2009-01-07 11:03:37 +01:00
parent f4bf0a3a6d
commit 7fcf6cb255
2 changed files with 9 additions and 4 deletions

View File

@@ -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;
}