| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |