Chromium Code Reviews| 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, {minify: true}) { | 7 String unparse(Node node, {minify: true}) { |
| 8 Unparser unparser = new Unparser(minify: minify); | 8 Unparser unparser = new Unparser(minify: minify); |
| 9 unparser.unparse(node); | 9 unparser.unparse(node); |
| 10 return unparser.result; | 10 return unparser.result; |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 117 indentMore(); | 117 indentMore(); |
| 118 for (Node member in members) { | 118 for (Node member in members) { |
| 119 visit(member); | 119 visit(member); |
| 120 newline(); | 120 newline(); |
| 121 } | 121 } |
| 122 indentLess(); | 122 indentLess(); |
| 123 } | 123 } |
| 124 write('}'); | 124 write('}'); |
| 125 } | 125 } |
| 126 | 126 |
| 127 visitEnum(Enum node) { | |
| 128 sb.write('enum '); | |
| 129 visit(node.name); | |
|
floitsch
2014/11/06 12:41:58
Why don't we need "{" and "}" here?
Johnni Winther
2014/11/06 12:49:41
It is in the NodeList [names].
| |
| 130 sb.write(' '); | |
| 131 visit(node.names); | |
| 132 } | |
| 133 | |
| 127 visitClassNode(ClassNode node) { | 134 visitClassNode(ClassNode node) { |
| 128 unparseClassWithBody(node, node.body.nodes); | 135 unparseClassWithBody(node, node.body.nodes); |
| 129 } | 136 } |
| 130 | 137 |
| 131 visitMixinApplication(MixinApplication node) { | 138 visitMixinApplication(MixinApplication node) { |
| 132 visit(node.superclass); | 139 visit(node.superclass); |
| 133 write(' with '); | 140 write(' with '); |
| 134 visit(node.mixins); | 141 visit(node.mixins); |
| 135 } | 142 } |
| 136 | 143 |
| (...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 794 } | 801 } |
| 795 | 802 |
| 796 visitStatement(Statement node) { | 803 visitStatement(Statement node) { |
| 797 throw 'internal error'; // Should not be called. | 804 throw 'internal error'; // Should not be called. |
| 798 } | 805 } |
| 799 | 806 |
| 800 visitStringNode(StringNode node) { | 807 visitStringNode(StringNode node) { |
| 801 throw 'internal error'; // Should not be called. | 808 throw 'internal error'; // Should not be called. |
| 802 } | 809 } |
| 803 } | 810 } |
| OLD | NEW |