Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(527)

Side by Side Diff: lib/compiler/implementation/dart_backend/emitter.dart

Issue 10913067: Simplify Unparser.unparseClassWithBody. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 String emitCode( 5 String emitCode(
6 Unparser unparser, 6 Unparser unparser,
7 Map<LibraryElement, String> imports, 7 Map<LibraryElement, String> imports,
8 Collection<Node> topLevelNodes, 8 Collection<Node> topLevelNodes,
9 Map<ClassNode, Collection<Node>> classMembers) { 9 Map<ClassNode, Collection<Node>> classMembers) {
10 imports.forEach((libraryElement, prefix) { 10 imports.forEach((libraryElement, prefix) {
11 unparser.unparseImportTag('${libraryElement.uri}', prefix); 11 unparser.unparseImportTag('${libraryElement.uri}', prefix);
12 }); 12 });
13 13
14 for (final node in topLevelNodes) { 14 for (final node in topLevelNodes) {
15 if (node is ClassNode) { 15 if (node is ClassNode) {
16 unparser.unparseClassWithBody(node, () { 16 // TODO(smok): Filter out default constructors here.
17 // TODO(smok): Filter out default constructors here. 17 unparser.unparseClassWithBody(node, classMembers[node]);
18 classMembers[node].forEach(unparser.unparse);
19 });
20 } else { 18 } else {
21 unparser.unparse(node); 19 unparser.unparse(node);
22 } 20 }
23 } 21 }
24 } 22 }
OLDNEW
« no previous file with comments | « no previous file | lib/compiler/implementation/tree/unparser.dart » ('j') | lib/compiler/implementation/tree/unparser.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698