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

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

Issue 1335983004: Add ImportElement and ExportElement (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comments. Created 5 years, 3 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/ssa/builder.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 680 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/ssa/builder.dart ('k') | pkg/compiler/lib/src/typechecker.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698