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 String unparse(Node node) { | 7 String unparse(Node node) { |
8 Unparser unparser = new Unparser(); | 8 Unparser unparser = new Unparser(); |
9 unparser.unparse(node); | 9 unparser.unparse(node); |
10 return unparser.result; | 10 return unparser.result; |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 for (final member in members) { | 74 for (final member in members) { |
75 visit(member); | 75 visit(member); |
76 } | 76 } |
77 sb.add('}'); | 77 sb.add('}'); |
78 } | 78 } |
79 | 79 |
80 visitClassNode(ClassNode node) { | 80 visitClassNode(ClassNode node) { |
81 unparseClassWithBody(node, node.body.nodes); | 81 unparseClassWithBody(node, node.body.nodes); |
82 } | 82 } |
83 | 83 |
| 84 visitMixinApplication(MixinApplication node) { |
| 85 if (!node.modifiers.nodes.isEmpty) { |
| 86 visit(node.modifiers); |
| 87 sb.add(' '); |
| 88 } |
| 89 visit(node.superclass); |
| 90 sb.add(' with '); |
| 91 visit(node.mixins); |
| 92 } |
| 93 |
| 94 visitNamedMixinApplication(NamedMixinApplication node) { |
| 95 sb.add('typedef '); |
| 96 visit(node.name); |
| 97 if (node.typeParameters != null) { |
| 98 visit(node.typeParameters); |
| 99 } |
| 100 sb.add(' = '); |
| 101 visit(node.mixinApplication); |
| 102 sb.add(';'); |
| 103 } |
| 104 |
84 visitConditional(Conditional node) { | 105 visitConditional(Conditional node) { |
85 visit(node.condition); | 106 visit(node.condition); |
86 add(node.questionToken.value); | 107 add(node.questionToken.value); |
87 visit(node.thenExpression); | 108 visit(node.thenExpression); |
88 add(node.colonToken.value); | 109 add(node.colonToken.value); |
89 visit(node.elseExpression); | 110 visit(node.elseExpression); |
90 } | 111 } |
91 | 112 |
92 visitExpressionStatement(ExpressionStatement node) { | 113 visitExpressionStatement(ExpressionStatement node) { |
93 visit(node.expression); | 114 visit(node.expression); |
(...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
596 } | 617 } |
597 | 618 |
598 visitStatement(Statement node) { | 619 visitStatement(Statement node) { |
599 throw 'internal error'; // Should not be called. | 620 throw 'internal error'; // Should not be called. |
600 } | 621 } |
601 | 622 |
602 visitStringNode(StringNode node) { | 623 visitStringNode(StringNode node) { |
603 throw 'internal error'; // Should not be called. | 624 throw 'internal error'; // Should not be called. |
604 } | 625 } |
605 } | 626 } |
OLD | NEW |