From ab474061a6de718620b3756cbcbbd7bf8ecce29b Mon Sep 17 00:00:00 2001 From: Roberto Raggi <qtc-committer@nokia.com> Date: Mon, 5 Jan 2009 16:10:56 +0100 Subject: [PATCH] Pretty print declarator list. --- shared/cplusplus/PrettyPrinter.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/shared/cplusplus/PrettyPrinter.cpp b/shared/cplusplus/PrettyPrinter.cpp index ab086cb74c0..213d21a468a 100644 --- a/shared/cplusplus/PrettyPrinter.cpp +++ b/shared/cplusplus/PrettyPrinter.cpp @@ -35,7 +35,6 @@ #include "AST.h" #include <iostream> #include <string> -#include <assert.h> CPLUSPLUS_USE_NAMESPACE @@ -385,9 +384,13 @@ bool PrettyPrinter::visit(DeclaratorIdAST *ast) return false; } -bool PrettyPrinter::visit(DeclaratorListAST *) +bool PrettyPrinter::visit(DeclaratorListAST *ast) { - assert(0); + for (DeclaratorListAST *it = ast; it; it = it->next) { + accept(it->declarator); + if (it->next) + out << ", "; + } return false; } -- GitLab