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 dart_backend; | |
6 | |
7 String emitCode( | 5 String emitCode( |
8 Unparser unparser, | 6 Unparser unparser, |
9 Map<LibraryElement, String> imports, | 7 Map<LibraryElement, String> imports, |
10 Collection<Node> topLevelNodes, | 8 Collection<Node> topLevelNodes, |
11 Map<ClassNode, Collection<Node>> classMembers) { | 9 Map<ClassNode, Collection<Node>> classMembers) { |
12 imports.forEach((libraryElement, prefix) { | 10 imports.forEach((libraryElement, prefix) { |
13 unparser.unparseImportTag('${libraryElement.uri}', prefix); | 11 unparser.unparseImportTag('${libraryElement.uri}', prefix); |
14 }); | 12 }); |
15 | 13 |
16 for (final node in topLevelNodes) { | 14 for (final node in topLevelNodes) { |
17 if (node is ClassNode) { | 15 if (node is ClassNode) { |
18 // TODO(smok): Filter out default constructors here. | 16 // TODO(smok): Filter out default constructors here. |
19 unparser.unparseClassWithBody(node, classMembers[node]); | 17 unparser.unparseClassWithBody(node, classMembers[node]); |
20 } else { | 18 } else { |
21 unparser.unparse(node); | 19 unparser.unparse(node); |
22 } | 20 } |
23 } | 21 } |
24 } | 22 } |
OLD | NEW |