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

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

Issue 10824062: dart2dart (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated test statuses Created 8 years, 4 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 /** 5 /**
6 * Dart backend helper for converting program IR back to source code. 6 * Dart backend helper for converting program IR back to source code.
7 */ 7 */
8 class Emitter { 8 class Emitter {
9 9
10 final Compiler compiler; 10 final Compiler compiler;
(...skipping 16 matching lines...) Expand all
27 sb.add(classElement.beginToken.slowToString()); 27 sb.add(classElement.beginToken.slowToString());
28 if (classElement.beginToken.slowToString() == 'abstract') { 28 if (classElement.beginToken.slowToString() == 'abstract') {
29 sb.add(' '); 29 sb.add(' ');
30 sb.add(classElement.beginToken.next.slowToString()); // 'class' 30 sb.add(classElement.beginToken.next.slowToString()); // 'class'
31 } 31 }
32 sb.add(' '); 32 sb.add(' ');
33 sb.add(renamer.renameType(classElement.type)); 33 sb.add(renamer.renameType(classElement.type));
34 if (classNode.typeParameters !== null) { 34 if (classNode.typeParameters !== null) {
35 sb.add(unparser.unparse(classNode.typeParameters)); 35 sb.add(unparser.unparse(classNode.typeParameters));
36 } 36 }
37 renamer.setContext(classElement);
37 if (classNode.extendsKeyword !== null) { 38 if (classNode.extendsKeyword !== null) {
38 sb.add(' '); 39 sb.add(' ');
39 classNode.extendsKeyword.value.printOn(sb); 40 classNode.extendsKeyword.value.printOn(sb);
40 sb.add(' '); 41 sb.add(' ');
41 sb.add(renamer.renameType(classElement.supertype)); 42 sb.add(renamer.renameType(classElement.supertype));
42 } 43 }
43 if (!classNode.interfaces.isEmpty()) { 44 if (!classNode.interfaces.isEmpty()) {
44 sb.add(classElement.isInterface() ? ' extends ' : ' implements '); 45 sb.add(classElement.isInterface() ? ' extends ' : ' implements ');
45 sb.add(unparser.unparse(classNode.interfaces)); 46 sb.add(unparser.unparse(classNode.interfaces));
46 } 47 }
(...skipping 19 matching lines...) Expand all
66 if (element.isField()) { 67 if (element.isField()) {
67 assert(element is VariableElement); 68 assert(element is VariableElement);
68 sb.add(unparser.unparse(element.variables.parseNode(compiler))); 69 sb.add(unparser.unparse(element.variables.parseNode(compiler)));
69 } else { 70 } else {
70 sb.add(unparser.unparse(element.parseNode(compiler))); 71 sb.add(unparser.unparse(element.parseNode(compiler)));
71 } 72 }
72 } 73 }
73 74
74 String toString() => sb.toString(); 75 String toString() => sb.toString();
75 } 76 }
OLDNEW
« no previous file with comments | « no previous file | lib/compiler/implementation/dart_backend/renamer.dart » ('j') | tests/standalone/standalone.status » ('J')

Powered by Google App Engine
This is Rietveld 408576698