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 <stdarg.h> | 5 #include <stdarg.h> |
6 | 6 |
7 #include "src/v8.h" | 7 #include "src/v8.h" |
8 | 8 |
9 #include "src/ast-value-factory.h" | 9 #include "src/ast-value-factory.h" |
10 #include "src/base/platform/platform.h" | 10 #include "src/base/platform/platform.h" |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 | 111 |
112 | 112 |
113 void CallPrinter::VisitExportDeclaration(ExportDeclaration* node) {} | 113 void CallPrinter::VisitExportDeclaration(ExportDeclaration* node) {} |
114 | 114 |
115 | 115 |
116 void CallPrinter::VisitModuleLiteral(ModuleLiteral* node) { | 116 void CallPrinter::VisitModuleLiteral(ModuleLiteral* node) { |
117 VisitBlock(node->body()); | 117 VisitBlock(node->body()); |
118 } | 118 } |
119 | 119 |
120 | 120 |
121 void CallPrinter::VisitModuleVariable(ModuleVariable* node) { | |
122 Find(node->proxy()); | |
123 } | |
124 | |
125 | |
126 void CallPrinter::VisitModulePath(ModulePath* node) { Find(node->module()); } | 121 void CallPrinter::VisitModulePath(ModulePath* node) { Find(node->module()); } |
127 | 122 |
128 | 123 |
129 void CallPrinter::VisitModuleUrl(ModuleUrl* node) {} | 124 void CallPrinter::VisitModuleUrl(ModuleUrl* node) {} |
130 | 125 |
131 | 126 |
132 void CallPrinter::VisitModuleStatement(ModuleStatement* node) { | 127 void CallPrinter::VisitModuleStatement(ModuleStatement* node) { |
133 Find(node->body()); | 128 Find(node->body()); |
134 } | 129 } |
135 | 130 |
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
496 PrintLiteral(node->proxy()->name(), false); | 491 PrintLiteral(node->proxy()->name(), false); |
497 Print(";"); | 492 Print(";"); |
498 } | 493 } |
499 | 494 |
500 | 495 |
501 void PrettyPrinter::VisitModuleLiteral(ModuleLiteral* node) { | 496 void PrettyPrinter::VisitModuleLiteral(ModuleLiteral* node) { |
502 VisitBlock(node->body()); | 497 VisitBlock(node->body()); |
503 } | 498 } |
504 | 499 |
505 | 500 |
506 void PrettyPrinter::VisitModuleVariable(ModuleVariable* node) { | |
507 Visit(node->proxy()); | |
508 } | |
509 | |
510 | |
511 void PrettyPrinter::VisitModulePath(ModulePath* node) { | 501 void PrettyPrinter::VisitModulePath(ModulePath* node) { |
512 Visit(node->module()); | 502 Visit(node->module()); |
513 Print("."); | 503 Print("."); |
514 PrintLiteral(node->name(), false); | 504 PrintLiteral(node->name(), false); |
515 } | 505 } |
516 | 506 |
517 | 507 |
518 void PrettyPrinter::VisitModuleUrl(ModuleUrl* node) { | 508 void PrettyPrinter::VisitModuleUrl(ModuleUrl* node) { |
519 Print("at "); | 509 Print("at "); |
520 PrintLiteral(node->url(), true); | 510 PrintLiteral(node->url(), true); |
521 } | 511 } |
522 | 512 |
523 | 513 |
524 void PrettyPrinter::VisitModuleStatement(ModuleStatement* node) { | 514 void PrettyPrinter::VisitModuleStatement(ModuleStatement* node) { |
525 Print("module "); | 515 Print("module "); |
526 PrintLiteral(node->proxy()->name(), false); | |
527 Print(" "); | |
528 Visit(node->body()); | 516 Visit(node->body()); |
529 } | 517 } |
530 | 518 |
531 | 519 |
532 void PrettyPrinter::VisitExpressionStatement(ExpressionStatement* node) { | 520 void PrettyPrinter::VisitExpressionStatement(ExpressionStatement* node) { |
533 Visit(node->expression()); | 521 Visit(node->expression()); |
534 Print(";"); | 522 Print(";"); |
535 } | 523 } |
536 | 524 |
537 | 525 |
(...skipping 696 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1234 PrintLiteral(node->proxy()->name(), true); | 1222 PrintLiteral(node->proxy()->name(), true); |
1235 } | 1223 } |
1236 | 1224 |
1237 | 1225 |
1238 void AstPrinter::VisitModuleLiteral(ModuleLiteral* node) { | 1226 void AstPrinter::VisitModuleLiteral(ModuleLiteral* node) { |
1239 IndentedScope indent(this, "MODULE LITERAL"); | 1227 IndentedScope indent(this, "MODULE LITERAL"); |
1240 VisitBlock(node->body()); | 1228 VisitBlock(node->body()); |
1241 } | 1229 } |
1242 | 1230 |
1243 | 1231 |
1244 void AstPrinter::VisitModuleVariable(ModuleVariable* node) { | |
1245 IndentedScope indent(this, "MODULE VARIABLE"); | |
1246 Visit(node->proxy()); | |
1247 } | |
1248 | |
1249 | |
1250 void AstPrinter::VisitModulePath(ModulePath* node) { | 1232 void AstPrinter::VisitModulePath(ModulePath* node) { |
1251 IndentedScope indent(this, "MODULE PATH"); | 1233 IndentedScope indent(this, "MODULE PATH"); |
1252 PrintIndentedVisit("MODULE PATH PARENT", node->module()); | 1234 PrintIndentedVisit("MODULE PATH PARENT", node->module()); |
1253 PrintLiteralIndented("NAME", node->name(), true); | 1235 PrintLiteralIndented("NAME", node->name(), true); |
1254 } | 1236 } |
1255 | 1237 |
1256 | 1238 |
1257 void AstPrinter::VisitModuleUrl(ModuleUrl* node) { | 1239 void AstPrinter::VisitModuleUrl(ModuleUrl* node) { |
1258 PrintLiteralIndented("URL", node->url(), true); | 1240 PrintLiteralIndented("URL", node->url(), true); |
1259 } | 1241 } |
1260 | 1242 |
1261 | 1243 |
1262 void AstPrinter::VisitModuleStatement(ModuleStatement* node) { | 1244 void AstPrinter::VisitModuleStatement(ModuleStatement* node) { |
1263 IndentedScope indent(this, "MODULE STATEMENT"); | 1245 IndentedScope indent(this, "MODULE STATEMENT"); |
1264 PrintLiteralIndented("NAME", node->proxy()->name(), true); | |
1265 PrintStatements(node->body()->statements()); | 1246 PrintStatements(node->body()->statements()); |
1266 } | 1247 } |
1267 | 1248 |
1268 | 1249 |
1269 void AstPrinter::VisitExpressionStatement(ExpressionStatement* node) { | 1250 void AstPrinter::VisitExpressionStatement(ExpressionStatement* node) { |
1270 IndentedScope indent(this, "EXPRESSION STATEMENT"); | 1251 IndentedScope indent(this, "EXPRESSION STATEMENT"); |
1271 Visit(node->expression()); | 1252 Visit(node->expression()); |
1272 } | 1253 } |
1273 | 1254 |
1274 | 1255 |
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1598 } | 1579 } |
1599 | 1580 |
1600 | 1581 |
1601 void AstPrinter::VisitSuperReference(SuperReference* node) { | 1582 void AstPrinter::VisitSuperReference(SuperReference* node) { |
1602 IndentedScope indent(this, "SUPER-REFERENCE"); | 1583 IndentedScope indent(this, "SUPER-REFERENCE"); |
1603 } | 1584 } |
1604 | 1585 |
1605 #endif // DEBUG | 1586 #endif // DEBUG |
1606 | 1587 |
1607 } } // namespace v8::internal | 1588 } } // namespace v8::internal |
OLD | NEW |