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/prettyprinter.h" | 5 #include "src/prettyprinter.h" |
6 | 6 |
7 #include <stdarg.h> | 7 #include <stdarg.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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 | 107 |
108 | 108 |
109 void CallPrinter::VisitExpressionStatement(ExpressionStatement* node) { | 109 void CallPrinter::VisitExpressionStatement(ExpressionStatement* node) { |
110 Find(node->expression()); | 110 Find(node->expression()); |
111 } | 111 } |
112 | 112 |
113 | 113 |
114 void CallPrinter::VisitEmptyStatement(EmptyStatement* node) {} | 114 void CallPrinter::VisitEmptyStatement(EmptyStatement* node) {} |
115 | 115 |
116 | 116 |
| 117 void CallPrinter::VisitDelegateStatement(DelegateStatement* node) { |
| 118 Find(node->statement()); |
| 119 } |
| 120 |
| 121 |
117 void CallPrinter::VisitIfStatement(IfStatement* node) { | 122 void CallPrinter::VisitIfStatement(IfStatement* node) { |
118 Find(node->condition()); | 123 Find(node->condition()); |
119 Find(node->then_statement()); | 124 Find(node->then_statement()); |
120 if (node->HasElseStatement()) { | 125 if (node->HasElseStatement()) { |
121 Find(node->else_statement()); | 126 Find(node->else_statement()); |
122 } | 127 } |
123 } | 128 } |
124 | 129 |
125 | 130 |
126 void CallPrinter::VisitContinueStatement(ContinueStatement* node) {} | 131 void CallPrinter::VisitContinueStatement(ContinueStatement* node) {} |
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
492 Visit(node->expression()); | 497 Visit(node->expression()); |
493 Print(";"); | 498 Print(";"); |
494 } | 499 } |
495 | 500 |
496 | 501 |
497 void PrettyPrinter::VisitEmptyStatement(EmptyStatement* node) { | 502 void PrettyPrinter::VisitEmptyStatement(EmptyStatement* node) { |
498 Print(";"); | 503 Print(";"); |
499 } | 504 } |
500 | 505 |
501 | 506 |
| 507 void PrettyPrinter::VisitDelegateStatement(DelegateStatement* node) { |
| 508 Visit(node->statement()); |
| 509 } |
| 510 |
| 511 |
502 void PrettyPrinter::VisitIfStatement(IfStatement* node) { | 512 void PrettyPrinter::VisitIfStatement(IfStatement* node) { |
503 Print("if ("); | 513 Print("if ("); |
504 Visit(node->condition()); | 514 Visit(node->condition()); |
505 Print(") "); | 515 Print(") "); |
506 Visit(node->then_statement()); | 516 Visit(node->then_statement()); |
507 if (node->HasElseStatement()) { | 517 if (node->HasElseStatement()) { |
508 Print(" else "); | 518 Print(" else "); |
509 Visit(node->else_statement()); | 519 Visit(node->else_statement()); |
510 } | 520 } |
511 } | 521 } |
(...skipping 697 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1209 IndentedScope indent(this, "EXPRESSION STATEMENT"); | 1219 IndentedScope indent(this, "EXPRESSION STATEMENT"); |
1210 Visit(node->expression()); | 1220 Visit(node->expression()); |
1211 } | 1221 } |
1212 | 1222 |
1213 | 1223 |
1214 void AstPrinter::VisitEmptyStatement(EmptyStatement* node) { | 1224 void AstPrinter::VisitEmptyStatement(EmptyStatement* node) { |
1215 IndentedScope indent(this, "EMPTY"); | 1225 IndentedScope indent(this, "EMPTY"); |
1216 } | 1226 } |
1217 | 1227 |
1218 | 1228 |
| 1229 void AstPrinter::VisitDelegateStatement(DelegateStatement* node) { |
| 1230 Visit(node->statement()); |
| 1231 } |
| 1232 |
| 1233 |
1219 void AstPrinter::VisitIfStatement(IfStatement* node) { | 1234 void AstPrinter::VisitIfStatement(IfStatement* node) { |
1220 IndentedScope indent(this, "IF"); | 1235 IndentedScope indent(this, "IF"); |
1221 PrintIndentedVisit("CONDITION", node->condition()); | 1236 PrintIndentedVisit("CONDITION", node->condition()); |
1222 PrintIndentedVisit("THEN", node->then_statement()); | 1237 PrintIndentedVisit("THEN", node->then_statement()); |
1223 if (node->HasElseStatement()) { | 1238 if (node->HasElseStatement()) { |
1224 PrintIndentedVisit("ELSE", node->else_statement()); | 1239 PrintIndentedVisit("ELSE", node->else_statement()); |
1225 } | 1240 } |
1226 } | 1241 } |
1227 | 1242 |
1228 | 1243 |
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1590 | 1605 |
1591 void AstPrinter::VisitSuperCallReference(SuperCallReference* node) { | 1606 void AstPrinter::VisitSuperCallReference(SuperCallReference* node) { |
1592 IndentedScope indent(this, "SUPER-CALL-REFERENCE"); | 1607 IndentedScope indent(this, "SUPER-CALL-REFERENCE"); |
1593 } | 1608 } |
1594 | 1609 |
1595 | 1610 |
1596 #endif // DEBUG | 1611 #endif // DEBUG |
1597 | 1612 |
1598 } // namespace internal | 1613 } // namespace internal |
1599 } // namespace v8 | 1614 } // namespace v8 |
OLD | NEW |