| 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 680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 691 newline(); | 691 newline(); |
| 692 indentMore(); | 692 indentMore(); |
| 693 visit(node.labelsAndCases); | 693 visit(node.labelsAndCases); |
| 694 if (node.isDefaultCase) { | 694 if (node.isDefaultCase) { |
| 695 write('default:'); | 695 write('default:'); |
| 696 } | 696 } |
| 697 unparseBlockStatements(node.statements); | 697 unparseBlockStatements(node.statements); |
| 698 indentLess(); | 698 indentLess(); |
| 699 } | 699 } |
| 700 | 700 |
| 701 unparseLibraryName(String libraryName) { |
| 702 write('library $libraryName;'); |
| 703 newline(); |
| 704 } |
| 705 |
| 701 unparseImportTag(String uri, {String prefix, | 706 unparseImportTag(String uri, {String prefix, |
| 702 List<String> shows: const <String>[], | 707 List<String> shows: const <String>[], |
| 703 bool isDeferred: false}) { | 708 bool isDeferred: false}) { |
| 704 String deferredString = isDeferred ? ' deferred' : ''; | 709 String deferredString = isDeferred ? ' deferred' : ''; |
| 705 String prefixString = prefix == null ? '' : ' as $prefix'; | 710 String prefixString = prefix == null ? '' : ' as $prefix'; |
| 706 String showString = shows.isEmpty ? '' : ' show ${shows.join(", ")}'; | 711 String showString = shows.isEmpty ? '' : ' show ${shows.join(", ")}'; |
| 707 write('import "$uri"$deferredString$prefixString$showString;'); | 712 write('import "$uri"$deferredString$prefixString$showString;'); |
| 708 newline(); | 713 newline(); |
| 709 } | 714 } |
| 710 | 715 |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 850 } | 855 } |
| 851 | 856 |
| 852 visitStatement(Statement node) { | 857 visitStatement(Statement node) { |
| 853 throw 'internal error'; // Should not be called. | 858 throw 'internal error'; // Should not be called. |
| 854 } | 859 } |
| 855 | 860 |
| 856 visitStringNode(StringNode node) { | 861 visitStringNode(StringNode node) { |
| 857 throw 'internal error'; // Should not be called. | 862 throw 'internal error'; // Should not be called. |
| 858 } | 863 } |
| 859 } | 864 } |
| OLD | NEW |