| 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 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 OS::Print("))"); | 260 OS::Print("))"); |
| 261 } | 261 } |
| 262 | 262 |
| 263 | 263 |
| 264 void AstPrinter::VisitClosureNode(ClosureNode* node) { | 264 void AstPrinter::VisitClosureNode(ClosureNode* node) { |
| 265 const char* function_fullname = node->function().ToFullyQualifiedCString(); | 265 const char* function_fullname = node->function().ToFullyQualifiedCString(); |
| 266 OS::Print("(%s '%s')", node->Name(), function_fullname); | 266 OS::Print("(%s '%s')", node->Name(), function_fullname); |
| 267 } | 267 } |
| 268 | 268 |
| 269 | 269 |
| 270 void AstPrinter::VisitImplicitStaticClosureNode( | |
| 271 ImplicitStaticClosureNode* node) { | |
| 272 const char* function_fullname = node->function().ToFullyQualifiedCString(); | |
| 273 OS::Print("static (%s '%s')", node->Name(), function_fullname); | |
| 274 } | |
| 275 | |
| 276 | |
| 277 void AstPrinter::VisitImplicitInstanceClosureNode( | |
| 278 ImplicitInstanceClosureNode* node) { | |
| 279 const char* function_fullname = node->function().ToFullyQualifiedCString(); | |
| 280 OS::Print("(%s '%s')", node->Name(), function_fullname); | |
| 281 } | |
| 282 | |
| 283 | |
| 284 void AstPrinter::VisitClosureCallNode(ClosureCallNode* node) { | 270 void AstPrinter::VisitClosureCallNode(ClosureCallNode* node) { |
| 285 VisitGenericAstNode(node); | 271 VisitGenericAstNode(node); |
| 286 } | 272 } |
| 287 | 273 |
| 288 | 274 |
| 289 void AstPrinter::VisitConstructorCallNode(ConstructorCallNode* node) { | 275 void AstPrinter::VisitConstructorCallNode(ConstructorCallNode* node) { |
| 290 const char* kind = node->constructor().IsFactory() ? "factory " : ""; | 276 const char* kind = node->constructor().IsFactory() ? "factory " : ""; |
| 291 const char* constructor_name = node->constructor().ToFullyQualifiedCString(); | 277 const char* constructor_name = node->constructor().ToFullyQualifiedCString(); |
| 292 OS::Print("(%s %s'%s' ((this)", node->Name(), kind, constructor_name); | 278 OS::Print("(%s %s'%s' ((this)", node->Name(), kind, constructor_name); |
| 293 node->VisitChildren(this); | 279 node->VisitChildren(this); |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 477 ASSERT(node_sequence != NULL); | 463 ASSERT(node_sequence != NULL); |
| 478 AstPrinter ast_printer; | 464 AstPrinter ast_printer; |
| 479 const char* function_name = | 465 const char* function_name = |
| 480 parsed_function.function().ToFullyQualifiedCString(); | 466 parsed_function.function().ToFullyQualifiedCString(); |
| 481 OS::Print("Ast for function '%s' {\n", function_name); | 467 OS::Print("Ast for function '%s' {\n", function_name); |
| 482 node_sequence->Visit(&ast_printer); | 468 node_sequence->Visit(&ast_printer); |
| 483 OS::Print("}\n"); | 469 OS::Print("}\n"); |
| 484 } | 470 } |
| 485 | 471 |
| 486 } // namespace dart | 472 } // namespace dart |
| OLD | NEW |