diff options
author | Roberto Raggi <qtc-committer@nokia.com> | 2009-01-07 10:42:43 +0100 |
---|---|---|
committer | Roberto Raggi <qtc-committer@nokia.com> | 2009-01-07 10:42:43 +0100 |
commit | f63d56a13b381115c340afee17982e7fcb50cf60 (patch) | |
tree | febafc522383ed79ba130162c6ee450549138604 /shared/cplusplus/PrettyPrinter.cpp | |
parent | ffbc28cbbd544e4c22f542322a9ea10a7660b8fc (diff) | |
download | qt-creator-f63d56a13b381115c340afee17982e7fcb50cf60.tar.gz |
Nicer pretty printing of while statements.
Diffstat (limited to 'shared/cplusplus/PrettyPrinter.cpp')
-rw-r--r-- | shared/cplusplus/PrettyPrinter.cpp | 11 |
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; } |