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

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

Issue 3003743002: Move tools to tool folder. (Closed)
Patch Set: Fix two problems that show up elsewhere. Created 3 years, 4 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
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.md file. 3 // BSD-style license that can be found in the LICENSE.md file.
4 4
5 // TODO(ahe): Copied from closure_conversion branch of kernel, remove this file 5 // TODO(ahe): Copied from closure_conversion branch of kernel, remove this file
6 // when closure_conversion is merged with master. 6 // when closure_conversion is merged with master.
7 7
8 library fasta.testing.kernel_chain; 8 library fasta.testing.kernel_chain;
9 9
10 import 'dart:async' show Future; 10 import 'dart:async' show Future;
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 } 63 }
64 64
65 class Verify extends Step<Program, Program, ChainContext> { 65 class Verify extends Step<Program, Program, ChainContext> {
66 final bool fullCompile; 66 final bool fullCompile;
67 67
68 const Verify(this.fullCompile); 68 const Verify(this.fullCompile);
69 69
70 String get name => "verify"; 70 String get name => "verify";
71 71
72 Future<Result<Program>> run(Program program, ChainContext context) async { 72 Future<Result<Program>> run(Program program, ChainContext context) async {
73 var options = 73 var options = new ProcessedOptions(new CompilerOptions());
74 new ProcessedOptions(new CompilerOptions()..throwOnErrors = false);
75 return await CompilerContext.runWithOptions(options, (_) async { 74 return await CompilerContext.runWithOptions(options, (_) async {
76 var errors = verifyProgram(program, isOutline: !fullCompile); 75 var errors = verifyProgram(program, isOutline: !fullCompile);
77 if (errors.isEmpty) { 76 if (errors.isEmpty) {
78 return pass(program); 77 return pass(program);
79 } else { 78 } else {
80 return new Result<Program>( 79 return new Result<Program>(
81 null, context.expectationSet["VerificationError"], errors, null); 80 null, context.expectationSet["VerificationError"], errors, null);
82 } 81 }
83 }); 82 });
84 } 83 }
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 257
259 Future openWrite(Uri uri, f(IOSink sink)) async { 258 Future openWrite(Uri uri, f(IOSink sink)) async {
260 IOSink sink = new File.fromUri(uri).openWrite(); 259 IOSink sink = new File.fromUri(uri).openWrite();
261 try { 260 try {
262 await f(sink); 261 await f(sink);
263 } finally { 262 } finally {
264 await sink.close(); 263 await sink.close();
265 } 264 }
266 print("Wrote $uri"); 265 print("Wrote $uri");
267 } 266 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698