OLD | NEW |
(Empty) | |
| 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 |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 |
| 5 import 'dart:io' show |
| 6 exit, |
| 7 exitCode; |
| 8 |
| 9 import 'package:fasta/src/ast_kind.dart' show |
| 10 AstKind; |
| 11 |
| 12 import 'package:fasta/src/compiler_command_line.dart' show |
| 13 CompilerCommandLine; |
| 14 |
| 15 import 'package:fasta/src/outline.dart' show |
| 16 doCompile, |
| 17 parseArguments; |
| 18 |
| 19 import 'package:fasta/src/errors.dart' show |
| 20 InputError; |
| 21 |
| 22 import 'package:fasta/src/run.dart' show |
| 23 run; |
| 24 |
| 25 import 'package:fasta/src/ticker.dart' show |
| 26 Ticker; |
| 27 |
| 28 const int iterations = const int.fromEnvironment("iterations", defaultValue: 1); |
| 29 |
| 30 main(List<String> arguments) async { |
| 31 Uri uri; |
| 32 CompilerCommandLine cl; |
| 33 for (int i = 0; i < iterations; i++) { |
| 34 if (i > 0) { |
| 35 print("\n"); |
| 36 } |
| 37 try { |
| 38 cl = parseArguments("run", arguments); |
| 39 uri = |
| 40 await doCompile(cl, new Ticker(isVerbose:cl.verbose), AstKind.Kernel); |
| 41 } on InputError catch (e) { |
| 42 print(e.format()); |
| 43 exit(1); |
| 44 } |
| 45 if (exitCode != 0) exit(exitCode); |
| 46 } |
| 47 exit(await run(uri, cl)); |
| 48 } |
OLD | NEW |