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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 FindStatements(node->statements()); | 94 FindStatements(node->statements()); |
95 } | 95 } |
96 | 96 |
97 | 97 |
98 void CallPrinter::VisitVariableDeclaration(VariableDeclaration* node) {} | 98 void CallPrinter::VisitVariableDeclaration(VariableDeclaration* node) {} |
99 | 99 |
100 | 100 |
101 void CallPrinter::VisitFunctionDeclaration(FunctionDeclaration* node) {} | 101 void CallPrinter::VisitFunctionDeclaration(FunctionDeclaration* node) {} |
102 | 102 |
103 | 103 |
104 void CallPrinter::VisitImportDeclaration(ImportDeclaration* node) { | |
105 } | |
106 | |
107 | |
108 void CallPrinter::VisitExpressionStatement(ExpressionStatement* node) { | 104 void CallPrinter::VisitExpressionStatement(ExpressionStatement* node) { |
109 Find(node->expression()); | 105 Find(node->expression()); |
110 } | 106 } |
111 | 107 |
112 | 108 |
113 void CallPrinter::VisitEmptyStatement(EmptyStatement* node) {} | 109 void CallPrinter::VisitEmptyStatement(EmptyStatement* node) {} |
114 | 110 |
115 | 111 |
116 void CallPrinter::VisitSloppyBlockFunctionStatement( | 112 void CallPrinter::VisitSloppyBlockFunctionStatement( |
117 SloppyBlockFunctionStatement* node) { | 113 SloppyBlockFunctionStatement* node) { |
(...skipping 618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
736 // TODO(svenpanne) Start with IndentedScope. | 732 // TODO(svenpanne) Start with IndentedScope. |
737 void AstPrinter::VisitFunctionDeclaration(FunctionDeclaration* node) { | 733 void AstPrinter::VisitFunctionDeclaration(FunctionDeclaration* node) { |
738 PrintIndented("FUNCTION "); | 734 PrintIndented("FUNCTION "); |
739 PrintLiteral(node->proxy()->name(), true); | 735 PrintLiteral(node->proxy()->name(), true); |
740 Print(" = function "); | 736 Print(" = function "); |
741 PrintLiteral(node->fun()->name(), false); | 737 PrintLiteral(node->fun()->name(), false); |
742 Print("\n"); | 738 Print("\n"); |
743 } | 739 } |
744 | 740 |
745 | 741 |
746 void AstPrinter::VisitImportDeclaration(ImportDeclaration* node) { | |
747 IndentedScope indent(this, "IMPORT", node->position()); | |
748 PrintLiteralIndented("NAME", node->proxy()->name(), true); | |
749 PrintLiteralIndented("FROM", node->module_specifier()->string(), true); | |
750 } | |
751 | |
752 | |
753 void AstPrinter::VisitExpressionStatement(ExpressionStatement* node) { | 742 void AstPrinter::VisitExpressionStatement(ExpressionStatement* node) { |
754 IndentedScope indent(this, "EXPRESSION STATEMENT", node->position()); | 743 IndentedScope indent(this, "EXPRESSION STATEMENT", node->position()); |
755 Visit(node->expression()); | 744 Visit(node->expression()); |
756 } | 745 } |
757 | 746 |
758 | 747 |
759 void AstPrinter::VisitEmptyStatement(EmptyStatement* node) { | 748 void AstPrinter::VisitEmptyStatement(EmptyStatement* node) { |
760 IndentedScope indent(this, "EMPTY", node->position()); | 749 IndentedScope indent(this, "EMPTY", node->position()); |
761 } | 750 } |
762 | 751 |
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1186 | 1175 |
1187 void AstPrinter::VisitRewritableExpression(RewritableExpression* node) { | 1176 void AstPrinter::VisitRewritableExpression(RewritableExpression* node) { |
1188 Visit(node->expression()); | 1177 Visit(node->expression()); |
1189 } | 1178 } |
1190 | 1179 |
1191 | 1180 |
1192 #endif // DEBUG | 1181 #endif // DEBUG |
1193 | 1182 |
1194 } // namespace internal | 1183 } // namespace internal |
1195 } // namespace v8 | 1184 } // namespace v8 |
OLD | NEW |