| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 part of tree; | 5 part of tree; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * Pretty-prints Node tree in XML-like format. | 8 * Pretty-prints Node tree in XML-like format. |
| 9 * | 9 * |
| 10 * TODO(smok): Add main() to run from command-line to print out tree for given | 10 * TODO(smok): Add main() to run from command-line to print out tree for given |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 node.accept(p); | 32 node.accept(p); |
| 33 return p.sb.toString(); | 33 return p.sb.toString(); |
| 34 } | 34 } |
| 35 | 35 |
| 36 visitNodeWithChildren(Node node, String type) { | 36 visitNodeWithChildren(Node node, String type) { |
| 37 openNode(node, type); | 37 openNode(node, type); |
| 38 node.visitChildren(this); | 38 node.visitChildren(this); |
| 39 closeNode(); | 39 closeNode(); |
| 40 } | 40 } |
| 41 | 41 |
| 42 visitAssert(Assert node) { |
| 43 visitNodeWithChildren(node, "Assert"); |
| 44 } |
| 45 |
| 42 visitAsyncModifier(AsyncModifier node) { | 46 visitAsyncModifier(AsyncModifier node) { |
| 43 openAndCloseNode(node, "AsyncModifier", | 47 openAndCloseNode(node, "AsyncModifier", |
| 44 {'asyncToken': node.asyncToken, | 48 {'asyncToken': node.asyncToken, |
| 45 'starToken': node.starToken}); | 49 'starToken': node.starToken}); |
| 46 } | 50 } |
| 47 | 51 |
| 48 visitBlock(Block node) { | 52 visitBlock(Block node) { |
| 49 visitNodeWithChildren(node, "Block"); | 53 visitNodeWithChildren(node, "Block"); |
| 50 } | 54 } |
| 51 | 55 |
| (...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 450 } | 454 } |
| 451 | 455 |
| 452 visitGotoStatement(GotoStatement node) { | 456 visitGotoStatement(GotoStatement node) { |
| 453 unimplemented('visitNode', node: node); | 457 unimplemented('visitNode', node: node); |
| 454 } | 458 } |
| 455 | 459 |
| 456 unimplemented(String message, {Node node}) { | 460 unimplemented(String message, {Node node}) { |
| 457 throw message; | 461 throw message; |
| 458 } | 462 } |
| 459 } | 463 } |
| OLD | NEW |