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

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

Issue 10836034: Properly parse operator declarations without return type. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Next iteration 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 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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 } 116 }
117 if (node.name is Send) { 117 if (node.name is Send) {
118 Send send = node.name; 118 Send send = node.name;
119 assert(send is !SendSet); 119 assert(send is !SendSet);
120 if (!send.isOperator) { 120 if (!send.isOperator) {
121 // Looks like a factory method. 121 // Looks like a factory method.
122 emitName(send.receiver); 122 emitName(send.receiver);
123 sb.add('.'); 123 sb.add('.');
124 } else { 124 } else {
125 visit(send.receiver); 125 visit(send.receiver);
126 if (send.selector.token.kind === KEYWORD_TOKEN) sb.add(' ');
126 } 127 }
127 visit(send.selector); 128 visit(send.selector);
128 } else { 129 } else {
129 if (node.name !== null) emitName(node.name); 130 if (node.name !== null) emitName(node.name);
130 } 131 }
131 visit(node.parameters); 132 visit(node.parameters);
132 visit(node.initializers); 133 visit(node.initializers);
133 visit(node.body); 134 visit(node.body);
134 } 135 }
135 136
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
509 sb.add(' '); 510 sb.add(' ');
510 } 511 }
511 visit(node.name); 512 visit(node.name);
512 if (node.typeParameters !== null) { 513 if (node.typeParameters !== null) {
513 visit(node.typeParameters); 514 visit(node.typeParameters);
514 } 515 }
515 visit(node.formals); 516 visit(node.formals);
516 add(node.endToken.value); 517 add(node.endToken.value);
517 } 518 }
518 } 519 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698