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

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

Issue 11090016: Change core lib, dart2js, and more for new optional parameters syntax (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 2 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 String unparse(Node node) { 5 String unparse(Node node) {
6 Unparser unparser = new Unparser(); 6 Unparser unparser = new Unparser();
7 unparser.unparse(node); 7 unparser.unparse(node);
8 return unparser.result; 8 return unparser.result;
9 } 9 }
10 10
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 sb.add(' '); 240 sb.add(' ');
241 } 241 }
242 add(node.beginToken.value); 242 add(node.beginToken.value);
243 if (node.hasExpression && node.beginToken.stringValue != '=>') { 243 if (node.hasExpression && node.beginToken.stringValue != '=>') {
244 sb.add(' '); 244 sb.add(' ');
245 } 245 }
246 visit(node.expression); 246 visit(node.expression);
247 if (node.endToken !== null) add(node.endToken.value); 247 if (node.endToken !== null) add(node.endToken.value);
248 } 248 }
249 249
250 unparseSendReceiver(Send node, [bool spacesNeeded=false]) { 250 unparseSendReceiver(Send node, {bool spacesNeeded: false}) {
251 if (node.receiver === null) return; 251 if (node.receiver === null) return;
252 visit(node.receiver); 252 visit(node.receiver);
253 CascadeReceiver asCascadeReceiver = node.receiver.asCascadeReceiver(); 253 CascadeReceiver asCascadeReceiver = node.receiver.asCascadeReceiver();
254 if (asCascadeReceiver !== null) { 254 if (asCascadeReceiver !== null) {
255 add(asCascadeReceiver.cascadeOperator.value); 255 add(asCascadeReceiver.cascadeOperator.value);
256 } else if (node.selector.asOperator() === null) { 256 } else if (node.selector.asOperator() === null) {
257 sb.add('.'); 257 sb.add('.');
258 } else if (spacesNeeded) { 258 } else if (spacesNeeded) {
259 sb.add(' '); 259 sb.add(' ');
260 } 260 }
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after
589 } 589 }
590 590
591 visitStatement(Statement node) { 591 visitStatement(Statement node) {
592 throw 'internal error'; // Should not be called. 592 throw 'internal error'; // Should not be called.
593 } 593 }
594 594
595 visitStringNode(StringNode node) { 595 visitStringNode(StringNode node) {
596 throw 'internal error'; // Should not be called. 596 throw 'internal error'; // Should not be called.
597 } 597 }
598 } 598 }
OLDNEW
« no previous file with comments | « lib/compiler/implementation/tree/nodes.dart ('k') | lib/compiler/implementation/types/concrete_types_inferrer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698