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

Side by Side Diff: dart/frog/leg/tree/unparser.dart

Issue 9109015: AST nodes for function-typed parameters. (Closed) Base URL: ssh://aaricia.aar/home/ahe/Dart/all/dart.googlecode.com.git@master
Patch Set: Created 8 years, 11 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
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 StringBuffer sb; 6 StringBuffer sb;
7 final bool printDebugInfo; 7 final bool printDebugInfo;
8 8
9 Unparser([this.printDebugInfo = false]); 9 Unparser([this.printDebugInfo = false]);
10 10
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 visitOperator(Operator node) { 145 visitOperator(Operator node) {
146 visitIdentifier(node); 146 visitIdentifier(node);
147 } 147 }
148 148
149 visitReturn(Return node) { 149 visitReturn(Return node) {
150 add(node.beginToken.value); 150 add(node.beginToken.value);
151 if (node.hasExpression) { 151 if (node.hasExpression) {
152 sb.add(' '); 152 sb.add(' ');
153 visit(node.expression); 153 visit(node.expression);
154 } 154 }
155 add(node.endToken.value); 155 if (node.endToken !== null) add(node.endToken.value);
ngeoffray 2012/01/06 08:20:46 Isn't the endToken the semi-colon? How can it be n
ahe 2012/01/06 11:00:03 For a function expression: print((() => 42)());
156 } 156 }
157 157
158 158
159 unparseSendPart(Send node) { 159 unparseSendPart(Send node) {
160 if (node.isPrefix) { 160 if (node.isPrefix) {
161 visit(node.selector); 161 visit(node.selector);
162 } 162 }
163 if (node.receiver !== null) { 163 if (node.receiver !== null) {
164 visit(node.receiver); 164 visit(node.receiver);
165 if (node.selector is !Operator) sb.add('.'); 165 if (node.selector is !Operator) sb.add('.');
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 sb.add(' '); 352 sb.add(' ');
353 } 353 }
354 visit(node.name); 354 visit(node.name);
355 if (node.typeParameters !== null) { 355 if (node.typeParameters !== null) {
356 visit(node.typeParameters); 356 visit(node.typeParameters);
357 } 357 }
358 visit(node.formals); 358 visit(node.formals);
359 add(node.endToken.value); 359 add(node.endToken.value);
360 } 360 }
361 } 361 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698