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

Side by Side Diff: pkg/compiler/lib/src/tree/unparser.dart

Issue 1151163004: Implementation of null-aware operators. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 7 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
« no previous file with comments | « pkg/compiler/lib/src/tree/nodes.dart ('k') | pkg/compiler/lib/src/typechecker.dart » ('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 part of tree; 5 part of tree;
6 6
7 String unparse(Node node, {minify: true}) { 7 String unparse(Node node, {minify: true}) {
8 Unparser unparser = new Unparser(minify: minify); 8 Unparser unparser = new Unparser(minify: minify);
9 unparser.unparse(node); 9 unparser.unparse(node);
10 return unparser.result; 10 return unparser.result;
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 visit(node.receiver); 417 visit(node.receiver);
418 CascadeReceiver asCascadeReceiver = node.receiver.asCascadeReceiver(); 418 CascadeReceiver asCascadeReceiver = node.receiver.asCascadeReceiver();
419 if (asCascadeReceiver != null) { 419 if (asCascadeReceiver != null) {
420 newline(); 420 newline();
421 indentMore(); 421 indentMore();
422 indentMore(); 422 indentMore();
423 write(asCascadeReceiver.cascadeOperator.value); 423 write(asCascadeReceiver.cascadeOperator.value);
424 indentLess(); 424 indentLess();
425 indentLess(); 425 indentLess();
426 } else if (node.selector.asOperator() == null) { 426 } else if (node.selector.asOperator() == null) {
427 write('.'); 427 write(node.isConditional ? '?.' : '.');
428 } else if (spacesNeeded) { 428 } else if (spacesNeeded) {
429 write(' '); 429 write(' ');
430 } 430 }
431 } 431 }
432 432
433 unparseSendArgument(Send node, {bool spacesNeeded: false}) { 433 unparseSendArgument(Send node, {bool spacesNeeded: false}) {
434 if (node.argumentsNode == null) return; 434 if (node.argumentsNode == null) return;
435 435
436 if(node.isIsNotCheck) { 436 if(node.isIsNotCheck) {
437 Send argNode = node.arguments.head; 437 Send argNode = node.arguments.head;
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after
850 } 850 }
851 851
852 visitStatement(Statement node) { 852 visitStatement(Statement node) {
853 throw 'internal error'; // Should not be called. 853 throw 'internal error'; // Should not be called.
854 } 854 }
855 855
856 visitStringNode(StringNode node) { 856 visitStringNode(StringNode node) {
857 throw 'internal error'; // Should not be called. 857 throw 'internal error'; // Should not be called.
858 } 858 }
859 } 859 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/tree/nodes.dart ('k') | pkg/compiler/lib/src/typechecker.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698