Revision f230a1cf deps/v8/src/prettyprinter.cc

View differences:

deps/v8/src/prettyprinter.cc
200 200
  Print(") { ");
201 201
  ZoneList<CaseClause*>* cases = node->cases();
202 202
  for (int i = 0; i < cases->length(); i++)
203
    PrintCaseClause(cases->at(i));
203
    Visit(cases->at(i));
204 204
  Print("}");
205 205
}
206 206

  
207 207

  
208
void PrettyPrinter::VisitCaseClause(CaseClause* clause) {
209
  if (clause->is_default()) {
210
    Print("default");
211
  } else {
212
    Print("case ");
213
    Visit(clause->label());
214
  }
215
  Print(": ");
216
  PrintStatements(clause->statements());
217
  if (clause->statements()->length() > 0)
218
    Print(" ");
219
}
220

  
221

  
208 222
void PrettyPrinter::VisitDoWhileStatement(DoWhileStatement* node) {
209 223
  PrintLabels(node->labels());
210 224
  Print("do ");
......
297 311
}
298 312

  
299 313

  
300
void PrettyPrinter::VisitSharedFunctionInfoLiteral(
301
    SharedFunctionInfoLiteral* node) {
314
void PrettyPrinter::VisitNativeFunctionLiteral(NativeFunctionLiteral* node) {
302 315
  Print("(");
303
  PrintLiteral(node->shared_function_info(), true);
316
  PrintLiteral(node->name(), false);
304 317
  Print(")");
305 318
}
306 319

  
......
621 634
}
622 635

  
623 636

  
624
void PrettyPrinter::PrintCaseClause(CaseClause* clause) {
625
  if (clause->is_default()) {
626
    Print("default");
627
  } else {
628
    Print("case ");
629
    Visit(clause->label());
630
  }
631
  Print(": ");
632
  PrintStatements(clause->statements());
633
  if (clause->statements()->length() > 0)
634
    Print(" ");
635
}
636

  
637

  
638 637
//-----------------------------------------------------------------------------
639 638

  
640 639
class IndentedScope BASE_EMBEDDED {
......
762 761
}
763 762

  
764 763

  
765
void AstPrinter::PrintCaseClause(CaseClause* clause) {
766
  if (clause->is_default()) {
767
    IndentedScope indent(this, "DEFAULT");
768
    PrintStatements(clause->statements());
769
  } else {
770
    IndentedScope indent(this, "CASE");
771
    Visit(clause->label());
772
    PrintStatements(clause->statements());
773
  }
774
}
775

  
776

  
777 764
void AstPrinter::VisitBlock(Block* node) {
778 765
  const char* block_txt = node->is_initializer_block() ? "BLOCK INIT" : "BLOCK";
779 766
  IndentedScope indent(this, block_txt);
......
901 888
  PrintLabelsIndented(node->labels());
902 889
  PrintIndentedVisit("TAG", node->tag());
903 890
  for (int i = 0; i < node->cases()->length(); i++) {
904
    PrintCaseClause(node->cases()->at(i));
891
    Visit(node->cases()->at(i));
892
  }
893
}
894

  
895

  
896
void AstPrinter::VisitCaseClause(CaseClause* clause) {
897
  if (clause->is_default()) {
898
    IndentedScope indent(this, "DEFAULT");
899
    PrintStatements(clause->statements());
900
  } else {
901
    IndentedScope indent(this, "CASE");
902
    Visit(clause->label());
903
    PrintStatements(clause->statements());
905 904
  }
906 905
}
907 906

  
......
982 981
}
983 982

  
984 983

  
985
void AstPrinter::VisitSharedFunctionInfoLiteral(
986
    SharedFunctionInfoLiteral* node) {
987
  IndentedScope indent(this, "FUNC LITERAL");
988
  PrintLiteralIndented("SHARED INFO", node->shared_function_info(), true);
984
void AstPrinter::VisitNativeFunctionLiteral(NativeFunctionLiteral* node) {
985
  IndentedScope indent(this, "NATIVE FUNC LITERAL");
986
  PrintLiteralIndented("NAME", node->name(), false);
989 987
}
990 988

  
991 989

  

Also available in: Unified diff