| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/ast_printer.h" | 5 #include "vm/ast_printer.h" |
| 6 | 6 |
| 7 #include "vm/handles.h" | 7 #include "vm/handles.h" |
| 8 #include "vm/object.h" | 8 #include "vm/object.h" |
| 9 #include "vm/os.h" | 9 #include "vm/os.h" |
| 10 #include "vm/parser.h" | 10 #include "vm/parser.h" |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 } | 187 } |
| 188 if (node->contains_default()) { | 188 if (node->contains_default()) { |
| 189 OS::Print(" default "); | 189 OS::Print(" default "); |
| 190 } | 190 } |
| 191 OS::Print(")"); | 191 OS::Print(")"); |
| 192 node->statements()->Visit(this); | 192 node->statements()->Visit(this); |
| 193 OS::Print(")"); | 193 OS::Print(")"); |
| 194 } | 194 } |
| 195 | 195 |
| 196 | 196 |
| 197 void AstPrinter::VisitSwitchNode(SwitchNode *node) { | 197 void AstPrinter::VisitSwitchNode(SwitchNode* node) { |
| 198 OS::Print("(switch "); | 198 OS::Print("(switch "); |
| 199 node->body()->Visit(this); | 199 node->body()->Visit(this); |
| 200 OS::Print(")"); | 200 OS::Print(")"); |
| 201 } | 201 } |
| 202 | 202 |
| 203 | 203 |
| 204 void AstPrinter::VisitWhileNode(WhileNode* node) { | 204 void AstPrinter::VisitWhileNode(WhileNode* node) { |
| 205 OS::Print("(while "); | 205 OS::Print("(while "); |
| 206 node->condition()->Visit(this); | 206 node->condition()->Visit(this); |
| 207 OS::Print(" do "); | 207 OS::Print(" do "); |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 471 ASSERT(node_sequence != NULL); | 471 ASSERT(node_sequence != NULL); |
| 472 AstPrinter ast_printer; | 472 AstPrinter ast_printer; |
| 473 const char* function_name = | 473 const char* function_name = |
| 474 parsed_function.function().ToFullyQualifiedCString(); | 474 parsed_function.function().ToFullyQualifiedCString(); |
| 475 OS::Print("Ast for function '%s' {\n", function_name); | 475 OS::Print("Ast for function '%s' {\n", function_name); |
| 476 node_sequence->Visit(&ast_printer); | 476 node_sequence->Visit(&ast_printer); |
| 477 OS::Print("}\n"); | 477 OS::Print("}\n"); |
| 478 } | 478 } |
| 479 | 479 |
| 480 } // namespace dart | 480 } // namespace dart |
| OLD | NEW |