| 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 30 matching lines...) Expand all Loading... |
| 41 void AstPrinter::VisitCloneContextNode(CloneContextNode* node) { | 41 void AstPrinter::VisitCloneContextNode(CloneContextNode* node) { |
| 42 VisitGenericAstNode(node); | 42 VisitGenericAstNode(node); |
| 43 } | 43 } |
| 44 | 44 |
| 45 | 45 |
| 46 void AstPrinter::VisitArgumentListNode(ArgumentListNode* arguments) { | 46 void AstPrinter::VisitArgumentListNode(ArgumentListNode* arguments) { |
| 47 VisitGenericAstNode(arguments); | 47 VisitGenericAstNode(arguments); |
| 48 } | 48 } |
| 49 | 49 |
| 50 | 50 |
| 51 void AstPrinter::VisitArgumentDefinitionTestNode( | |
| 52 ArgumentDefinitionTestNode* node) { | |
| 53 OS::Print("(%s ?%s @%"Pd")", | |
| 54 node->Name(), | |
| 55 node->formal_parameter_name().ToCString(), | |
| 56 node->formal_parameter_index()); | |
| 57 } | |
| 58 | |
| 59 | |
| 60 void AstPrinter::VisitReturnNode(ReturnNode* node) { | 51 void AstPrinter::VisitReturnNode(ReturnNode* node) { |
| 61 VisitGenericAstNode(node); | 52 VisitGenericAstNode(node); |
| 62 } | 53 } |
| 63 | 54 |
| 64 | 55 |
| 65 void AstPrinter::VisitGenericLocalNode(AstNode* node, | 56 void AstPrinter::VisitGenericLocalNode(AstNode* node, |
| 66 const LocalVariable& var) { | 57 const LocalVariable& var) { |
| 67 OS::Print("(%s %s%s '%s'", | 58 OS::Print("(%s %s%s '%s'", |
| 68 node->Name(), | 59 node->Name(), |
| 69 var.is_final() ? "final " : "", | 60 var.is_final() ? "final " : "", |
| (...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 498 ASSERT(node_sequence != NULL); | 489 ASSERT(node_sequence != NULL); |
| 499 AstPrinter ast_printer; | 490 AstPrinter ast_printer; |
| 500 const char* function_name = | 491 const char* function_name = |
| 501 parsed_function.function().ToFullyQualifiedCString(); | 492 parsed_function.function().ToFullyQualifiedCString(); |
| 502 OS::Print("Ast for function '%s' {\n", function_name); | 493 OS::Print("Ast for function '%s' {\n", function_name); |
| 503 node_sequence->Visit(&ast_printer); | 494 node_sequence->Visit(&ast_printer); |
| 504 OS::Print("}\n"); | 495 OS::Print("}\n"); |
| 505 } | 496 } |
| 506 | 497 |
| 507 } // namespace dart | 498 } // namespace dart |
| OLD | NEW |