| 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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) { | 84 visitMixinApplication(MixinApplication node) { |
| 85 if (!node.modifiers.nodes.isEmpty) { | |
| 86 visit(node.modifiers); | |
| 87 sb.add(' '); | |
| 88 } | |
| 89 visit(node.superclass); | 85 visit(node.superclass); |
| 90 sb.add(' with '); | 86 sb.add(' with '); |
| 91 visit(node.mixins); | 87 visit(node.mixins); |
| 92 } | 88 } |
| 93 | 89 |
| 94 visitNamedMixinApplication(NamedMixinApplication node) { | 90 visitNamedMixinApplication(NamedMixinApplication node) { |
| 95 sb.add('typedef '); | 91 sb.add('typedef '); |
| 96 visit(node.name); | 92 visit(node.name); |
| 97 if (node.typeParameters != null) { | 93 if (node.typeParameters != null) { |
| 98 visit(node.typeParameters); | 94 visit(node.typeParameters); |
| 99 } | 95 } |
| 100 sb.add(' = '); | 96 sb.add(' = '); |
| 97 if (!node.modifiers.nodes.isEmpty) { |
| 98 visit(node.modifiers); |
| 99 sb.add(' '); |
| 100 } |
| 101 visit(node.mixinApplication); | 101 visit(node.mixinApplication); |
| 102 if (node.interfaces != null) { |
| 103 sb.add(' implements '); |
| 104 visit(node.interfaces); |
| 105 } |
| 102 sb.add(';'); | 106 sb.add(';'); |
| 103 } | 107 } |
| 104 | 108 |
| 105 visitConditional(Conditional node) { | 109 visitConditional(Conditional node) { |
| 106 visit(node.condition); | 110 visit(node.condition); |
| 107 add(node.questionToken.value); | 111 add(node.questionToken.value); |
| 108 visit(node.thenExpression); | 112 visit(node.thenExpression); |
| 109 add(node.colonToken.value); | 113 add(node.colonToken.value); |
| 110 visit(node.elseExpression); | 114 visit(node.elseExpression); |
| 111 } | 115 } |
| (...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 617 } | 621 } |
| 618 | 622 |
| 619 visitStatement(Statement node) { | 623 visitStatement(Statement node) { |
| 620 throw 'internal error'; // Should not be called. | 624 throw 'internal error'; // Should not be called. |
| 621 } | 625 } |
| 622 | 626 |
| 623 visitStringNode(StringNode node) { | 627 visitStringNode(StringNode node) { |
| 624 throw 'internal error'; // Should not be called. | 628 throw 'internal error'; // Should not be called. |
| 625 } | 629 } |
| 626 } | 630 } |
| OLD | NEW |