summaryrefslogtreecommitdiff
path: root/shared/cplusplus/PrettyPrinter.cpp
diff options
context:
space:
mode:
authorRoberto Raggi <qtc-committer@nokia.com>2009-01-07 10:49:08 +0100
committerRoberto Raggi <qtc-committer@nokia.com>2009-01-07 10:49:08 +0100
commit8ec03e6bcd7d7ed7ee1e22c96bcfb46b86cdc3bf (patch)
treea38effab169b1fb3ef17d7140fb4dd5b4c57852d /shared/cplusplus/PrettyPrinter.cpp
parentf63d56a13b381115c340afee17982e7fcb50cf60 (diff)
downloadqt-creator-8ec03e6bcd7d7ed7ee1e22c96bcfb46b86cdc3bf.tar.gz
Pretty print char ltierals and wide char literals.
Diffstat (limited to 'shared/cplusplus/PrettyPrinter.cpp')
-rw-r--r--shared/cplusplus/PrettyPrinter.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/shared/cplusplus/PrettyPrinter.cpp b/shared/cplusplus/PrettyPrinter.cpp
index 6fcd06de38..620cb0bd2a 100644
--- a/shared/cplusplus/PrettyPrinter.cpp
+++ b/shared/cplusplus/PrettyPrinter.cpp
@@ -33,6 +33,7 @@
#include "PrettyPrinter.h"
#include "AST.h"
+#include "Token.h"
#include <iostream>
#include <string>
#include <cassert>
@@ -813,7 +814,17 @@ bool PrettyPrinter::visit(NewTypeIdAST *ast)
bool PrettyPrinter::visit(NumericLiteralAST *ast)
{
- out << spell(ast->token);
+ switch (tokenKind(ast->token)) {
+ case T_CHAR_LITERAL:
+ out << '\'' << spell(ast->token) << '\'';
+ break;
+ case T_WIDE_CHAR_LITERAL:
+ out << "L\'" << spell(ast->token) << '\'';
+ break;
+
+ default:
+ out << spell(ast->token);
+ }
return false;
}