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

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

Issue 11148014: Land 'Fix a crash related to obsolete factory syntax.'. (Closed) Base URL: https://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
« no previous file with comments | « lib/compiler/implementation/scanner/listener.dart ('k') | tests/co19/co19-dart2dart.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 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 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 visitSend(Send node) { 263 visitSend(Send node) {
264 Operator op = node.selector.asOperator(); 264 Operator op = node.selector.asOperator();
265 String opString = op !== null ? op.source.stringValue : null; 265 String opString = op !== null ? op.source.stringValue : null;
266 bool spacesNeeded = opString === 'is' || opString === 'as'; 266 bool spacesNeeded = opString === 'is' || opString === 'as';
267 267
268 if (node.isPrefix) visit(node.selector); 268 if (node.isPrefix) visit(node.selector);
269 unparseSendReceiver(node, spacesNeeded: spacesNeeded); 269 unparseSendReceiver(node, spacesNeeded: spacesNeeded);
270 if (!node.isPrefix && !node.isIndex) visit(node.selector); 270 if (!node.isPrefix && !node.isIndex) visit(node.selector);
271 if (spacesNeeded) sb.add(' '); 271 if (spacesNeeded) sb.add(' ');
272 // Also add a space for sequences like x + +1 and y - -y. 272 // Also add a space for sequences like x + +1 and y - -y.
273 if (opString === '-' || opString === '+') { 273 // TODO(ahe): remove case for '+' when we drop the support for it.
274 if (node.argumentsNode != null && (opString === '-' || opString === '+')) {
274 Token beginToken = node.argumentsNode.getBeginToken(); 275 Token beginToken = node.argumentsNode.getBeginToken();
275 if (beginToken !== null && beginToken.stringValue === opString) { 276 if (beginToken !== null && beginToken.stringValue === opString) {
276 sb.add(' '); 277 sb.add(' ');
277 } 278 }
278 } 279 }
279 visit(node.argumentsNode); 280 visit(node.argumentsNode);
280 } 281 }
281 282
282 visitSendSet(SendSet node) { 283 visitSendSet(SendSet node) {
283 if (node.isPrefix) { 284 if (node.isPrefix) {
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
588 } 589 }
589 590
590 visitStatement(Statement node) { 591 visitStatement(Statement node) {
591 throw 'internal error'; // Should not be called. 592 throw 'internal error'; // Should not be called.
592 } 593 }
593 594
594 visitStringNode(StringNode node) { 595 visitStringNode(StringNode node) {
595 throw 'internal error'; // Should not be called. 596 throw 'internal error'; // Should not be called.
596 } 597 }
597 } 598 }
OLDNEW
« no previous file with comments | « lib/compiler/implementation/scanner/listener.dart ('k') | tests/co19/co19-dart2dart.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698