diff options
Diffstat (limited to 'shared/cplusplus/PrettyPrinter.cpp')
-rw-r--r-- | shared/cplusplus/PrettyPrinter.cpp | 13 |
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; } |