Index: pkg/front_end/lib/src/fasta/bin/run.dart |
diff --git a/pkg/front_end/lib/src/fasta/bin/run.dart b/pkg/front_end/lib/src/fasta/bin/run.dart |
index 94bcc91217029732ab765f100bd28cc347ac4394..8585fa1cc158108ab6f14bfad23e760b9fc5491f 100644 |
--- a/pkg/front_end/lib/src/fasta/bin/run.dart |
+++ b/pkg/front_end/lib/src/fasta/bin/run.dart |
@@ -12,9 +12,11 @@ import 'package:front_end/src/fasta/ast_kind.dart' show |
import 'package:front_end/src/fasta/compiler_command_line.dart' show |
CompilerCommandLine; |
+import 'package:front_end/src/fasta/compiler_context.dart' show |
+ CompilerContext; |
+ |
import 'package:front_end/src/fasta/outline.dart' show |
- doCompile, |
- parseArguments; |
+ doCompile; |
import 'package:front_end/src/fasta/errors.dart' show |
InputError; |
@@ -29,20 +31,23 @@ const int iterations = const int.fromEnvironment("iterations", defaultValue: 1); |
main(List<String> arguments) async { |
Uri uri; |
- CompilerCommandLine cl; |
for (int i = 0; i < iterations; i++) { |
- if (i > 0) { |
- print("\n"); |
- } |
- try { |
- cl = parseArguments("run", arguments); |
- uri = |
- await doCompile(cl, new Ticker(isVerbose:cl.verbose), AstKind.Kernel); |
- } on InputError catch (e) { |
- print(e.format()); |
- exit(1); |
- } |
- if (exitCode != 0) exit(exitCode); |
+ await CompilerCommandLine.withGlobalOptions( |
+ "run", arguments, (CompilerContext c) async { |
+ if (i > 0) { |
+ print("\n"); |
+ } |
+ try { |
+ uri = await doCompile(c, new Ticker(isVerbose: c.options.verbose), |
+ AstKind.Kernel); |
+ } on InputError catch (e) { |
+ print(e.format()); |
+ exit(1); |
+ } |
+ if (exitCode != 0) exit(exitCode); |
+ if (i + 1 == iterations) { |
+ exit(await run(uri, c)); |
+ } |
+ }); |
} |
- exit(await run(uri, cl)); |
} |