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

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

Issue 10821101: Support cascade receivers. (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 | tests/language/language.status » ('j') | 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 class Unparser implements Visitor { 5 class Unparser implements Visitor {
6 final Renamer renamer; 6 final Renamer renamer;
7 StringBuffer sb; 7 StringBuffer sb;
8 8
9 Unparser([this.renamer = const Renamer()]); 9 Unparser([this.renamer = const Renamer()]);
10 10
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 unparseSendPart(Send node) { 226 unparseSendPart(Send node) {
227 Operator op = node.selector.asOperator(); 227 Operator op = node.selector.asOperator();
228 bool isCheck = op !== null && op.source.stringValue === 'is'; 228 bool isCheck = op !== null && op.source.stringValue === 'is';
229 229
230 if (node.isPrefix) { 230 if (node.isPrefix) {
231 visit(node.selector); 231 visit(node.selector);
232 } 232 }
233 if (node.receiver !== null) { 233 if (node.receiver !== null) {
234 visit(node.receiver); 234 visit(node.receiver);
235 if (op === null) { 235 if (op === null) {
236 sb.add('.'); 236 CascadeReceiver asCascadeReceiver = node.receiver.asCascadeReceiver();
237 if (asCascadeReceiver !== null) {
238 add(asCascadeReceiver.cascadeOperator.value);
239 } else {
240 sb.add('.');
241 }
237 } else if (isCheck) { 242 } else if (isCheck) {
238 sb.add(' '); 243 sb.add(' ');
239 } 244 }
240 } 245 }
241 if (!node.isPrefix && !node.isIndex) { 246 if (!node.isPrefix && !node.isIndex) {
242 visit(node.selector); 247 visit(node.selector);
243 } 248 }
244 if (isCheck) { 249 if (isCheck) {
245 sb.add(' '); 250 sb.add(' ');
246 } 251 }
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
505 sb.add(' '); 510 sb.add(' ');
506 } 511 }
507 visit(node.name); 512 visit(node.name);
508 if (node.typeParameters !== null) { 513 if (node.typeParameters !== null) {
509 visit(node.typeParameters); 514 visit(node.typeParameters);
510 } 515 }
511 visit(node.formals); 516 visit(node.formals);
512 add(node.endToken.value); 517 add(node.endToken.value);
513 } 518 }
514 } 519 }
OLDNEW
« no previous file with comments | « no previous file | tests/language/language.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698