OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/ast/prettyprinter.h" | 5 #include "src/ast/prettyprinter.h" |
6 | 6 |
7 #include <stdarg.h> | 7 #include <stdarg.h> |
8 | 8 |
9 #include "src/ast/ast-value-factory.h" | 9 #include "src/ast/ast-value-factory.h" |
10 #include "src/ast/scopes.h" | 10 #include "src/ast/scopes.h" |
(...skipping 704 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
715 void AstPrinter::VisitBlock(Block* node) { | 715 void AstPrinter::VisitBlock(Block* node) { |
716 const char* block_txt = | 716 const char* block_txt = |
717 node->ignore_completion_value() ? "BLOCK NOCOMPLETIONS" : "BLOCK"; | 717 node->ignore_completion_value() ? "BLOCK NOCOMPLETIONS" : "BLOCK"; |
718 IndentedScope indent(this, block_txt, node->position()); | 718 IndentedScope indent(this, block_txt, node->position()); |
719 PrintStatements(node->statements()); | 719 PrintStatements(node->statements()); |
720 } | 720 } |
721 | 721 |
722 | 722 |
723 // TODO(svenpanne) Start with IndentedScope. | 723 // TODO(svenpanne) Start with IndentedScope. |
724 void AstPrinter::VisitVariableDeclaration(VariableDeclaration* node) { | 724 void AstPrinter::VisitVariableDeclaration(VariableDeclaration* node) { |
725 PrintLiteralWithModeIndented(Variable::Mode2String(node->mode()), | 725 PrintLiteralWithModeIndented("VARIABLE", node->proxy()->var(), |
726 node->proxy()->var(), | |
727 node->proxy()->name()); | 726 node->proxy()->name()); |
728 } | 727 } |
729 | 728 |
730 | 729 |
731 // TODO(svenpanne) Start with IndentedScope. | 730 // TODO(svenpanne) Start with IndentedScope. |
732 void AstPrinter::VisitFunctionDeclaration(FunctionDeclaration* node) { | 731 void AstPrinter::VisitFunctionDeclaration(FunctionDeclaration* node) { |
733 PrintIndented("FUNCTION "); | 732 PrintIndented("FUNCTION "); |
734 PrintLiteral(node->proxy()->name(), true); | 733 PrintLiteral(node->proxy()->name(), true); |
735 Print(" = function "); | 734 Print(" = function "); |
736 PrintLiteral(node->fun()->name(), false); | 735 PrintLiteral(node->fun()->name(), false); |
(...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1192 | 1191 |
1193 void AstPrinter::VisitRewritableExpression(RewritableExpression* node) { | 1192 void AstPrinter::VisitRewritableExpression(RewritableExpression* node) { |
1194 Visit(node->expression()); | 1193 Visit(node->expression()); |
1195 } | 1194 } |
1196 | 1195 |
1197 | 1196 |
1198 #endif // DEBUG | 1197 #endif // DEBUG |
1199 | 1198 |
1200 } // namespace internal | 1199 } // namespace internal |
1201 } // namespace v8 | 1200 } // namespace v8 |
OLD | NEW |