| 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 27 matching lines...) Expand all Loading... |
| 38 VisitGenericAstNode(node); | 38 VisitGenericAstNode(node); |
| 39 } | 39 } |
| 40 | 40 |
| 41 | 41 |
| 42 void AstPrinter::VisitArgumentListNode(ArgumentListNode* arguments) { | 42 void AstPrinter::VisitArgumentListNode(ArgumentListNode* arguments) { |
| 43 VisitGenericAstNode(arguments); | 43 VisitGenericAstNode(arguments); |
| 44 } | 44 } |
| 45 | 45 |
| 46 | 46 |
| 47 void AstPrinter::VisitReturnNode(ReturnNode* node) { | 47 void AstPrinter::VisitReturnNode(ReturnNode* node) { |
| 48 VisitGenericAstNode(node); | |
| 49 OS::Print("(%s %s", | 48 OS::Print("(%s %s", |
| 50 node->PrettyName(), | 49 node->PrettyName(), |
| 51 (node->return_type() == ReturnNode::kContinuation) ? | 50 (node->return_type() == ReturnNode::kContinuation) ? |
| 52 "continuation" : ""); | 51 "continuation " : ""); |
| 53 node->VisitChildren(this); | 52 node->VisitChildren(this); |
| 54 OS::Print(")"); | 53 OS::Print(")"); |
| 55 } | 54 } |
| 56 | 55 |
| 57 | 56 |
| 58 void AstPrinter::VisitGenericLocalNode(AstNode* node, | 57 void AstPrinter::VisitGenericLocalNode(AstNode* node, |
| 59 const LocalVariable& var) { | 58 const LocalVariable& var) { |
| 60 OS::Print("(%s %s%s \"%s\"", | 59 OS::Print("(%s %s%s \"%s\"", |
| 61 node->PrettyName(), | 60 node->PrettyName(), |
| 62 var.is_final() ? "final " : "", | 61 var.is_final() ? "final " : "", |
| (...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 530 ASSERT(node_sequence != NULL); | 529 ASSERT(node_sequence != NULL); |
| 531 AstPrinter ast_printer; | 530 AstPrinter ast_printer; |
| 532 const char* function_name = | 531 const char* function_name = |
| 533 parsed_function.function().ToFullyQualifiedCString(); | 532 parsed_function.function().ToFullyQualifiedCString(); |
| 534 OS::Print("Ast for function '%s' {\n", function_name); | 533 OS::Print("Ast for function '%s' {\n", function_name); |
| 535 node_sequence->Visit(&ast_printer); | 534 node_sequence->Visit(&ast_printer); |
| 536 OS::Print("}\n"); | 535 OS::Print("}\n"); |
| 537 } | 536 } |
| 538 | 537 |
| 539 } // namespace dart | 538 } // namespace dart |
| OLD | NEW |