| Index: src/prettyprinter.cc
|
| diff --git a/src/prettyprinter.cc b/src/prettyprinter.cc
|
| index 14ad707da7ca917a7a5524d177ba71f55dbfb236..4b441b9ae41f520e670d98e6643f9264899a17a5 100644
|
| --- a/src/prettyprinter.cc
|
| +++ b/src/prettyprinter.cc
|
| @@ -200,11 +200,25 @@ void PrettyPrinter::VisitSwitchStatement(SwitchStatement* node) {
|
| Print(") { ");
|
| ZoneList<CaseClause*>* cases = node->cases();
|
| for (int i = 0; i < cases->length(); i++)
|
| - PrintCaseClause(cases->at(i));
|
| + Visit(cases->at(i));
|
| Print("}");
|
| }
|
|
|
|
|
| +void PrettyPrinter::VisitCaseClause(CaseClause* clause) {
|
| + if (clause->is_default()) {
|
| + Print("default");
|
| + } else {
|
| + Print("case ");
|
| + Visit(clause->label());
|
| + }
|
| + Print(": ");
|
| + PrintStatements(clause->statements());
|
| + if (clause->statements()->length() > 0)
|
| + Print(" ");
|
| +}
|
| +
|
| +
|
| void PrettyPrinter::VisitDoWhileStatement(DoWhileStatement* node) {
|
| PrintLabels(node->labels());
|
| Print("do ");
|
| @@ -620,20 +634,6 @@ void PrettyPrinter::PrintFunctionLiteral(FunctionLiteral* function) {
|
| }
|
|
|
|
|
| -void PrettyPrinter::PrintCaseClause(CaseClause* clause) {
|
| - if (clause->is_default()) {
|
| - Print("default");
|
| - } else {
|
| - Print("case ");
|
| - Visit(clause->label());
|
| - }
|
| - Print(": ");
|
| - PrintStatements(clause->statements());
|
| - if (clause->statements()->length() > 0)
|
| - Print(" ");
|
| -}
|
| -
|
| -
|
| //-----------------------------------------------------------------------------
|
|
|
| class IndentedScope BASE_EMBEDDED {
|
| @@ -761,18 +761,6 @@ void AstPrinter::PrintArguments(ZoneList<Expression*>* arguments) {
|
| }
|
|
|
|
|
| -void AstPrinter::PrintCaseClause(CaseClause* clause) {
|
| - if (clause->is_default()) {
|
| - IndentedScope indent(this, "DEFAULT");
|
| - PrintStatements(clause->statements());
|
| - } else {
|
| - IndentedScope indent(this, "CASE");
|
| - Visit(clause->label());
|
| - PrintStatements(clause->statements());
|
| - }
|
| -}
|
| -
|
| -
|
| void AstPrinter::VisitBlock(Block* node) {
|
| const char* block_txt = node->is_initializer_block() ? "BLOCK INIT" : "BLOCK";
|
| IndentedScope indent(this, block_txt);
|
| @@ -900,7 +888,19 @@ void AstPrinter::VisitSwitchStatement(SwitchStatement* node) {
|
| PrintLabelsIndented(node->labels());
|
| PrintIndentedVisit("TAG", node->tag());
|
| for (int i = 0; i < node->cases()->length(); i++) {
|
| - PrintCaseClause(node->cases()->at(i));
|
| + Visit(node->cases()->at(i));
|
| + }
|
| +}
|
| +
|
| +
|
| +void AstPrinter::VisitCaseClause(CaseClause* clause) {
|
| + if (clause->is_default()) {
|
| + IndentedScope indent(this, "DEFAULT");
|
| + PrintStatements(clause->statements());
|
| + } else {
|
| + IndentedScope indent(this, "CASE");
|
| + Visit(clause->label());
|
| + PrintStatements(clause->statements());
|
| }
|
| }
|
|
|
|
|