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

Side by Side Diff: pkg/front_end/lib/src/fasta/fasta.dart

Issue 2893233003: Let printProgramText() to use filter to print only some libraries. (Closed)
Patch Set: Created 3 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 | « no previous file | pkg/front_end/lib/src/fasta/kernel/kernel_target.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) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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 library fasta; 5 library fasta;
6 6
7 import 'dart:async' show Future; 7 import 'dart:async' show Future;
8 8
9 import 'dart:convert' show JSON; 9 import 'dart:convert' show JSON;
10 10
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 Uri uri = Uri.base.resolve(argument); 141 Uri uri = Uri.base.resolve(argument);
142 String path = uriTranslator.translate(uri)?.path ?? argument; 142 String path = uriTranslator.translate(uri)?.path ?? argument;
143 if (path.endsWith(".dart")) { 143 if (path.endsWith(".dart")) {
144 kernelTarget.read(uri); 144 kernelTarget.read(uri);
145 } else { 145 } else {
146 inputError(uri, -1, "Unexpected input: $uri"); 146 inputError(uri, -1, "Unexpected input: $uri");
147 } 147 }
148 await dillTarget.buildOutlines(); 148 await dillTarget.buildOutlines();
149 var outline = await kernelTarget.buildOutlines(); 149 var outline = await kernelTarget.buildOutlines();
150 if (c.options.dumpIr && output != null) { 150 if (c.options.dumpIr && output != null) {
151 printProgramText(outline); 151 printProgramText(outline, libraryFilter: kernelTarget.isSourceLibrary);
152 } 152 }
153 if (output != null) { 153 if (output != null) {
154 await writeProgramToFile(outline, output); 154 await writeProgramToFile(outline, output);
155 ticker.logMs("Wrote outline to ${output.toFilePath()}"); 155 ticker.logMs("Wrote outline to ${output.toFilePath()}");
156 } 156 }
157 return kernelTarget; 157 return kernelTarget;
158 } 158 }
159 159
160 Future<Uri> compile() async { 160 Future<Uri> compile() async {
161 KernelTarget kernelTarget = await buildOutline(); 161 KernelTarget kernelTarget = await buildOutline();
162 if (exitCode != 0) return null; 162 if (exitCode != 0) return null;
163 Uri uri = c.options.output; 163 Uri uri = c.options.output;
164 var program = await kernelTarget.buildProgram(verify: c.options.verify); 164 var program = await kernelTarget.buildProgram(verify: c.options.verify);
165 if (c.options.dumpIr) printProgramText(program); 165 if (c.options.dumpIr) {
166 printProgramText(program, libraryFilter: kernelTarget.isSourceLibrary);
167 }
166 await writeProgramToFile(program, uri); 168 await writeProgramToFile(program, uri);
167 ticker.logMs("Wrote program to ${uri.toFilePath()}"); 169 ticker.logMs("Wrote program to ${uri.toFilePath()}");
168 return uri; 170 return uri;
169 } 171 }
170 } 172 }
171 173
172 Future<CompilationResult> parseScript( 174 Future<CompilationResult> parseScript(
173 Uri fileName, Uri packages, Uri patchedSdk, 175 Uri fileName, Uri packages, Uri patchedSdk,
174 {bool verbose: false, bool strongMode: false}) async { 176 {bool verbose: false, bool strongMode: false}) async {
175 return parseScriptInFileSystem( 177 return parseScriptInFileSystem(
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 final BytesBuilder builder = new BytesBuilder(); 299 final BytesBuilder builder = new BytesBuilder();
298 300
299 void add(List<int> data) { 301 void add(List<int> data) {
300 builder.add(data); 302 builder.add(data);
301 } 303 }
302 304
303 void close() { 305 void close() {
304 // Nothing to do. 306 // Nothing to do.
305 } 307 }
306 } 308 }
OLDNEW
« no previous file with comments | « no previous file | pkg/front_end/lib/src/fasta/kernel/kernel_target.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698