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 | |
46 visitAsyncModifier(AsyncModifier node) { | 42 visitAsyncModifier(AsyncModifier node) { |
47 openAndCloseNode(node, "AsyncModifier", | 43 openAndCloseNode(node, "AsyncModifier", |
48 {'asyncToken': node.asyncToken, | 44 {'asyncToken': node.asyncToken, |
49 'starToken': node.starToken}); | 45 'starToken': node.starToken}); |
50 } | 46 } |
51 | 47 |
52 visitBlock(Block node) { | 48 visitBlock(Block node) { |
53 visitNodeWithChildren(node, "Block"); | 49 visitNodeWithChildren(node, "Block"); |
54 } | 50 } |
55 | 51 |
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
454 } | 450 } |
455 | 451 |
456 visitGotoStatement(GotoStatement node) { | 452 visitGotoStatement(GotoStatement node) { |
457 unimplemented('visitNode', node: node); | 453 unimplemented('visitNode', node: node); |
458 } | 454 } |
459 | 455 |
460 unimplemented(String message, {Node node}) { | 456 unimplemented(String message, {Node node}) { |
461 throw message; | 457 throw message; |
462 } | 458 } |
463 } | 459 } |
OLD | NEW |