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