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 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 Print(" : "); | 318 Print(" : "); |
319 Visit(node->else_expression()); | 319 Visit(node->else_expression()); |
320 } | 320 } |
321 | 321 |
322 | 322 |
323 void PrettyPrinter::VisitLiteral(Literal* node) { | 323 void PrettyPrinter::VisitLiteral(Literal* node) { |
324 PrintLiteral(node->value(), true); | 324 PrintLiteral(node->value(), true); |
325 } | 325 } |
326 | 326 |
327 | 327 |
| 328 void PrettyPrinter::VisitTemplateLiteral(TemplateLiteral* node) {} |
| 329 |
| 330 |
328 void PrettyPrinter::VisitRegExpLiteral(RegExpLiteral* node) { | 331 void PrettyPrinter::VisitRegExpLiteral(RegExpLiteral* node) { |
329 Print(" RegExp("); | 332 Print(" RegExp("); |
330 PrintLiteral(node->pattern(), false); | 333 PrintLiteral(node->pattern(), false); |
331 Print(","); | 334 Print(","); |
332 PrintLiteral(node->flags(), false); | 335 PrintLiteral(node->flags(), false); |
333 Print(") "); | 336 Print(") "); |
334 } | 337 } |
335 | 338 |
336 | 339 |
337 void PrettyPrinter::VisitObjectLiteral(ObjectLiteral* node) { | 340 void PrettyPrinter::VisitObjectLiteral(ObjectLiteral* node) { |
(...skipping 671 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1009 PrintIndentedVisit("ELSE", node->else_expression()); | 1012 PrintIndentedVisit("ELSE", node->else_expression()); |
1010 } | 1013 } |
1011 | 1014 |
1012 | 1015 |
1013 // TODO(svenpanne) Start with IndentedScope. | 1016 // TODO(svenpanne) Start with IndentedScope. |
1014 void AstPrinter::VisitLiteral(Literal* node) { | 1017 void AstPrinter::VisitLiteral(Literal* node) { |
1015 PrintLiteralIndented("LITERAL", node->value(), true); | 1018 PrintLiteralIndented("LITERAL", node->value(), true); |
1016 } | 1019 } |
1017 | 1020 |
1018 | 1021 |
| 1022 void AstPrinter::VisitTemplateLiteral(TemplateLiteral* node) {} |
| 1023 |
| 1024 |
1019 void AstPrinter::VisitRegExpLiteral(RegExpLiteral* node) { | 1025 void AstPrinter::VisitRegExpLiteral(RegExpLiteral* node) { |
1020 IndentedScope indent(this, "REGEXP LITERAL"); | 1026 IndentedScope indent(this, "REGEXP LITERAL"); |
1021 PrintLiteralIndented("PATTERN", node->pattern(), false); | 1027 PrintLiteralIndented("PATTERN", node->pattern(), false); |
1022 PrintLiteralIndented("FLAGS", node->flags(), false); | 1028 PrintLiteralIndented("FLAGS", node->flags(), false); |
1023 } | 1029 } |
1024 | 1030 |
1025 | 1031 |
1026 void AstPrinter::VisitObjectLiteral(ObjectLiteral* node) { | 1032 void AstPrinter::VisitObjectLiteral(ObjectLiteral* node) { |
1027 IndentedScope indent(this, "OBJ LITERAL"); | 1033 IndentedScope indent(this, "OBJ LITERAL"); |
1028 for (int i = 0; i < node->properties()->length(); i++) { | 1034 for (int i = 0; i < node->properties()->length(); i++) { |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1178 } | 1184 } |
1179 | 1185 |
1180 | 1186 |
1181 void AstPrinter::VisitSuperReference(SuperReference* node) { | 1187 void AstPrinter::VisitSuperReference(SuperReference* node) { |
1182 IndentedScope indent(this, "SUPER-REFERENCE"); | 1188 IndentedScope indent(this, "SUPER-REFERENCE"); |
1183 } | 1189 } |
1184 | 1190 |
1185 #endif // DEBUG | 1191 #endif // DEBUG |
1186 | 1192 |
1187 } } // namespace v8::internal | 1193 } } // namespace v8::internal |
OLD | NEW |