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

Side by Side Diff: lib/compiler/implementation/tree/unparser.dart

Issue 10855203: Fix a warning. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 // Returns null if no need to rename a node. 5 // Returns null if no need to rename a node.
6 typedef String Renamer(Node node); 6 typedef String Renamer(Node node);
7 7
8 class Unparser implements Visitor { 8 class Unparser implements Visitor {
9 Renamer rename; 9 Renamer rename;
10 StringBuffer sb; 10 StringBuffer sb;
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 // arguments. 123 // arguments.
124 if (node.name is Send) { 124 if (node.name is Send) {
125 Send send = node.name; 125 Send send = node.name;
126 assert(send is !SendSet); 126 assert(send is !SendSet);
127 if (!send.isOperator) { 127 if (!send.isOperator) {
128 // Looks like a factory method. 128 // Looks like a factory method.
129 visit(send.receiver); 129 visit(send.receiver);
130 sb.add('.'); 130 sb.add('.');
131 } else { 131 } else {
132 visit(send.receiver); 132 visit(send.receiver);
133 if (send.selector.token.kind === KEYWORD_TOKEN) sb.add(' '); 133 if (send.selector.asIdentifier().token.kind === KEYWORD_TOKEN) {
134 sb.add(' ');
135 }
134 } 136 }
135 visit(send.selector); 137 visit(send.selector);
136 } else { 138 } else {
137 visit(node.name); 139 visit(node.name);
138 } 140 }
139 visit(node.parameters); 141 visit(node.parameters);
140 visit(node.initializers); 142 visit(node.initializers);
141 visit(node.body); 143 visit(node.body);
142 } 144 }
143 145
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
486 sb.add(' '); 488 sb.add(' ');
487 } 489 }
488 visit(node.name); 490 visit(node.name);
489 if (node.typeParameters !== null) { 491 if (node.typeParameters !== null) {
490 visit(node.typeParameters); 492 visit(node.typeParameters);
491 } 493 }
492 visit(node.formals); 494 visit(node.formals);
493 add(node.endToken.value); 495 add(node.endToken.value);
494 } 496 }
495 } 497 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698