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/log.h" | 8 #include "vm/log.h" |
9 #include "vm/object.h" | 9 #include "vm/object.h" |
10 #include "vm/os.h" | 10 #include "vm/os.h" |
11 #include "vm/parser.h" | 11 #include "vm/parser.h" |
12 | 12 |
| 13 #if !defined(PRODUCT) |
| 14 |
13 namespace dart { | 15 namespace dart { |
14 | 16 |
15 #ifndef PRODUCT | |
16 | |
17 AstPrinter::AstPrinter() : indent_(0) { } | 17 AstPrinter::AstPrinter() : indent_(0) { } |
18 | 18 |
19 | 19 |
20 AstPrinter::~AstPrinter() { } | 20 AstPrinter::~AstPrinter() { } |
21 | 21 |
22 | 22 |
23 void AstPrinter::VisitGenericAstNode(AstNode* node) { | 23 void AstPrinter::VisitGenericAstNode(AstNode* node) { |
24 THR_Print("(%s ", node->PrettyName()); | 24 THR_Print("(%s ", node->PrettyName()); |
25 node->VisitChildren(this); | 25 node->VisitChildren(this); |
26 THR_Print(")"); | 26 THR_Print(")"); |
(...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
569 SequenceNode* node_sequence = parsed_function.node_sequence(); | 569 SequenceNode* node_sequence = parsed_function.node_sequence(); |
570 ASSERT(node_sequence != NULL); | 570 ASSERT(node_sequence != NULL); |
571 AstPrinter ast_printer; | 571 AstPrinter ast_printer; |
572 const char* function_name = | 572 const char* function_name = |
573 parsed_function.function().ToFullyQualifiedCString(); | 573 parsed_function.function().ToFullyQualifiedCString(); |
574 THR_Print("Ast for function '%s' {\n", function_name); | 574 THR_Print("Ast for function '%s' {\n", function_name); |
575 node_sequence->Visit(&ast_printer); | 575 node_sequence->Visit(&ast_printer); |
576 THR_Print("}\n"); | 576 THR_Print("}\n"); |
577 } | 577 } |
578 | 578 |
579 #endif // !PRODUCT | 579 } // namespace dart |
580 | 580 |
581 } // namespace dart | 581 #endif // !defined(PRODUCT) |
OLD | NEW |