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

Unified Diff: pkg/front_end/lib/src/fasta/bin/run.dart

Issue 2704753002: Implement line and column numbers. (Closed)
Patch Set: Change message. Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
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));
}
« no previous file with comments | « pkg/front_end/lib/src/fasta/analyzer/ast_builder.dart ('k') | pkg/front_end/lib/src/fasta/builder/builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698