Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(48)

Side by Side Diff: src/ast/prettyprinter.cc

Issue 2108193003: [modules] AST and parser rework. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@anonymous-declarations
Patch Set: Rebase. Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/ast/modules.cc ('k') | src/ast/scopes.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
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
OLDNEW
« no previous file with comments | « src/ast/modules.cc ('k') | src/ast/scopes.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698