| Index: src/ast/prettyprinter.cc
|
| diff --git a/src/ast/prettyprinter.cc b/src/ast/prettyprinter.cc
|
| index 00b31168ea5c31c445fff69570f2982ae44a0972..30005b8d5102a826010c5992df114288dd2ab6c3 100644
|
| --- a/src/ast/prettyprinter.cc
|
| +++ b/src/ast/prettyprinter.cc
|
| @@ -99,8 +99,7 @@ void CallPrinter::VisitVariableDeclaration(VariableDeclaration* node) {}
|
| void CallPrinter::VisitFunctionDeclaration(FunctionDeclaration* node) {}
|
|
|
|
|
| -void CallPrinter::VisitImportDeclaration(ImportDeclaration* node) {
|
| -}
|
| +void CallPrinter::VisitImportDeclaration(ImportDeclaration* node) {}
|
|
|
|
|
| void CallPrinter::VisitExportDeclaration(ExportDeclaration* node) {}
|
| @@ -465,9 +464,7 @@ PrettyPrinter::PrettyPrinter(Isolate* isolate) {
|
| }
|
|
|
|
|
| -PrettyPrinter::~PrettyPrinter() {
|
| - DeleteArray(output_);
|
| -}
|
| +PrettyPrinter::~PrettyPrinter() { DeleteArray(output_); }
|
|
|
|
|
| void PrettyPrinter::VisitBlock(Block* node) {
|
| @@ -516,9 +513,7 @@ void PrettyPrinter::VisitExpressionStatement(ExpressionStatement* node) {
|
| }
|
|
|
|
|
| -void PrettyPrinter::VisitEmptyStatement(EmptyStatement* node) {
|
| - Print(";");
|
| -}
|
| +void PrettyPrinter::VisitEmptyStatement(EmptyStatement* node) { Print(";"); }
|
|
|
|
|
| void PrettyPrinter::VisitSloppyBlockFunctionStatement(
|
| @@ -584,8 +579,7 @@ void PrettyPrinter::VisitSwitchStatement(SwitchStatement* node) {
|
| Visit(node->tag());
|
| Print(") { ");
|
| ZoneList<CaseClause*>* cases = node->cases();
|
| - for (int i = 0; i < cases->length(); i++)
|
| - Visit(cases->at(i));
|
| + for (int i = 0; i < cases->length(); i++) Visit(cases->at(i));
|
| Print("}");
|
| }
|
|
|
| @@ -599,8 +593,7 @@ void PrettyPrinter::VisitCaseClause(CaseClause* clause) {
|
| }
|
| Print(": ");
|
| PrintStatements(clause->statements());
|
| - if (clause->statements()->length() > 0)
|
| - Print(" ");
|
| + if (clause->statements()->length() > 0) Print(" ");
|
| }
|
|
|
|
|
| @@ -918,7 +911,7 @@ const char* PrettyPrinter::Print(AstNode* node) {
|
| const char* PrettyPrinter::PrintExpression(FunctionLiteral* program) {
|
| Init();
|
| ExpressionStatement* statement =
|
| - program->body()->at(0)->AsExpressionStatement();
|
| + program->body()->at(0)->AsExpressionStatement();
|
| Visit(statement->expression());
|
| return output_;
|
| }
|
| @@ -954,9 +947,7 @@ void PrettyPrinter::Print(const char* format, ...) {
|
| for (;;) {
|
| va_list arguments;
|
| va_start(arguments, format);
|
| - int n = VSNPrintF(Vector<char>(output_, size_) + pos_,
|
| - format,
|
| - arguments);
|
| + int n = VSNPrintF(Vector<char>(output_, size_) + pos_, format, arguments);
|
| va_end(arguments);
|
|
|
| if (n >= 0) {
|
| @@ -1052,7 +1043,7 @@ void PrettyPrinter::PrintLiteral(const AstRawString* value, bool quote) {
|
| void PrettyPrinter::PrintParameters(Scope* scope) {
|
| Print("(");
|
| for (int i = 0; i < scope->num_parameters(); i++) {
|
| - if (i > 0) Print(", ");
|
| + if (i > 0) Print(", ");
|
| PrintLiteral(scope->parameter(i)->name(), false);
|
| }
|
| Print(")");
|
| @@ -1082,8 +1073,7 @@ void PrettyPrinter::PrintFunctionLiteral(FunctionLiteral* function) {
|
|
|
| class IndentedScope BASE_EMBEDDED {
|
| public:
|
| - IndentedScope(AstPrinter* printer, const char* txt)
|
| - : ast_printer_(printer) {
|
| + IndentedScope(AstPrinter* printer, const char* txt) : ast_printer_(printer) {
|
| ast_printer_->PrintIndented(txt);
|
| ast_printer_->Print("\n");
|
| ast_printer_->inc_indent();
|
| @@ -1096,9 +1086,7 @@ class IndentedScope BASE_EMBEDDED {
|
| ast_printer_->inc_indent();
|
| }
|
|
|
| - virtual ~IndentedScope() {
|
| - ast_printer_->dec_indent();
|
| - }
|
| + virtual ~IndentedScope() { ast_printer_->dec_indent(); }
|
|
|
| private:
|
| AstPrinter* ast_printer_;
|
| @@ -1111,9 +1099,7 @@ class IndentedScope BASE_EMBEDDED {
|
| AstPrinter::AstPrinter(Isolate* isolate) : PrettyPrinter(isolate), indent_(0) {}
|
|
|
|
|
| -AstPrinter::~AstPrinter() {
|
| - DCHECK(indent_ == 0);
|
| -}
|
| +AstPrinter::~AstPrinter() { DCHECK(indent_ == 0); }
|
|
|
|
|
| void AstPrinter::PrintIndented(const char* txt) {
|
| @@ -1124,8 +1110,7 @@ void AstPrinter::PrintIndented(const char* txt) {
|
| }
|
|
|
|
|
| -void AstPrinter::PrintLiteralIndented(const char* info,
|
| - Handle<Object> value,
|
| +void AstPrinter::PrintLiteralIndented(const char* info, Handle<Object> value,
|
| bool quote) {
|
| PrintIndented(info);
|
| Print(" ");
|
| @@ -1134,8 +1119,7 @@ void AstPrinter::PrintLiteralIndented(const char* info,
|
| }
|
|
|
|
|
| -void AstPrinter::PrintLiteralWithModeIndented(const char* info,
|
| - Variable* var,
|
| +void AstPrinter::PrintLiteralWithModeIndented(const char* info, Variable* var,
|
| Handle<Object> value) {
|
| if (var == NULL) {
|
| PrintLiteralIndented(info, value, true);
|
| @@ -1165,7 +1149,8 @@ void AstPrinter::PrintIndentedVisit(const char* s, AstNode* node) {
|
|
|
| const char* AstPrinter::PrintProgram(FunctionLiteral* program) {
|
| Init();
|
| - { IndentedScope indent(this, "FUNC", program->position());
|
| + {
|
| + IndentedScope indent(this, "FUNC", program->position());
|
| PrintLiteralIndented("NAME", program->name(), true);
|
| PrintLiteralIndented("INFERRED NAME", program->inferred_name(), true);
|
| PrintParameters(program->scope());
|
| @@ -1222,8 +1207,7 @@ void AstPrinter::VisitBlock(Block* node) {
|
| // TODO(svenpanne) Start with IndentedScope.
|
| void AstPrinter::VisitVariableDeclaration(VariableDeclaration* node) {
|
| PrintLiteralWithModeIndented(Variable::Mode2String(node->mode()),
|
| - node->proxy()->var(),
|
| - node->proxy()->name());
|
| + node->proxy()->var(), node->proxy()->name());
|
| }
|
|
|
|
|
| @@ -1369,8 +1353,7 @@ void AstPrinter::VisitForOfStatement(ForOfStatement* node) {
|
| void AstPrinter::VisitTryCatchStatement(TryCatchStatement* node) {
|
| IndentedScope indent(this, "TRY CATCH", node->position());
|
| PrintIndentedVisit("TRY", node->try_block());
|
| - PrintLiteralWithModeIndented("CATCHVAR",
|
| - node->variable(),
|
| + PrintLiteralWithModeIndented("CATCHVAR", node->variable(),
|
| node->variable()->name());
|
| PrintIndentedVisit("CATCH", node->catch_block());
|
| }
|
|
|