| 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 unparseClassWithBody(node, node.body.nodes); | 77 unparseClassWithBody(node, node.body.nodes); |
| 78 } | 78 } |
| 79 | 79 |
| 80 visitMixinApplication(MixinApplication node) { | 80 visitMixinApplication(MixinApplication node) { |
| 81 visit(node.superclass); | 81 visit(node.superclass); |
| 82 sb.write(' with '); | 82 sb.write(' with '); |
| 83 visit(node.mixins); | 83 visit(node.mixins); |
| 84 } | 84 } |
| 85 | 85 |
| 86 visitNamedMixinApplication(NamedMixinApplication node) { | 86 visitNamedMixinApplication(NamedMixinApplication node) { |
| 87 sb.write('typedef '); | 87 if (!node.modifiers.nodes.isEmpty) { |
| 88 visit(node.modifiers); |
| 89 sb.write(' '); |
| 90 } |
| 91 sb.write('class '); |
| 88 visit(node.name); | 92 visit(node.name); |
| 89 if (node.typeParameters != null) { | 93 if (node.typeParameters != null) { |
| 90 visit(node.typeParameters); | 94 visit(node.typeParameters); |
| 91 } | 95 } |
| 92 sb.write(' = '); | 96 sb.write(' = '); |
| 93 if (!node.modifiers.nodes.isEmpty) { | |
| 94 visit(node.modifiers); | |
| 95 sb.write(' '); | |
| 96 } | |
| 97 visit(node.mixinApplication); | 97 visit(node.mixinApplication); |
| 98 if (node.interfaces != null) { | 98 if (node.interfaces != null) { |
| 99 sb.write(' implements '); | 99 sb.write(' implements '); |
| 100 visit(node.interfaces); | 100 visit(node.interfaces); |
| 101 } | 101 } |
| 102 sb.write(';'); | 102 sb.write(';'); |
| 103 } | 103 } |
| 104 | 104 |
| 105 visitConditional(Conditional node) { | 105 visitConditional(Conditional node) { |
| 106 visit(node.condition); | 106 visit(node.condition); |
| (...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 606 } | 606 } |
| 607 | 607 |
| 608 visitStatement(Statement node) { | 608 visitStatement(Statement node) { |
| 609 throw 'internal error'; // Should not be called. | 609 throw 'internal error'; // Should not be called. |
| 610 } | 610 } |
| 611 | 611 |
| 612 visitStringNode(StringNode node) { | 612 visitStringNode(StringNode node) { |
| 613 throw 'internal error'; // Should not be called. | 613 throw 'internal error'; // Should not be called. |
| 614 } | 614 } |
| 615 } | 615 } |
| OLD | NEW |