summaryrefslogtreecommitdiff
path: root/shared/cplusplus/PrettyPrinter.cpp
diff options
context:
space:
mode:
authorRoberto Raggi <qtc-committer@nokia.com>2009-01-07 10:42:43 +0100
committerRoberto Raggi <qtc-committer@nokia.com>2009-01-07 10:42:43 +0100
commitf63d56a13b381115c340afee17982e7fcb50cf60 (patch)
treefebafc522383ed79ba130162c6ee450549138604 /shared/cplusplus/PrettyPrinter.cpp
parentffbc28cbbd544e4c22f542322a9ea10a7660b8fc (diff)
downloadqt-creator-f63d56a13b381115c340afee17982e7fcb50cf60.tar.gz
Nicer pretty printing of while statements.
Diffstat (limited to 'shared/cplusplus/PrettyPrinter.cpp')
-rw-r--r--shared/cplusplus/PrettyPrinter.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/shared/cplusplus/PrettyPrinter.cpp b/shared/cplusplus/PrettyPrinter.cpp
index d7570127e3..6fcd06de38 100644
--- a/shared/cplusplus/PrettyPrinter.cpp
+++ b/shared/cplusplus/PrettyPrinter.cpp
@@ -1229,7 +1229,16 @@ bool PrettyPrinter::visit(WhileStatementAST *ast)
out << '(';
accept(ast->condition);
out << ')';
- accept(ast->statement);
+ out << ' ';
+ if (ast->statement && ast->statement->asCompoundStatement())
+ accept(ast->statement);
+ else {
+ indent();
+ newline();
+ accept(ast->statement);
+ deindent();
+ newline();
+ }
return false;
}