Chromium Code Reviews| Index: pkg/front_end/lib/src/fasta/compiler_command_line.dart |
| diff --git a/pkg/front_end/lib/src/fasta/compiler_command_line.dart b/pkg/front_end/lib/src/fasta/compiler_command_line.dart |
| index 2413488ea7a3f6f6db6f4cff02130b882f52c465..3c1ebed2c1ed0cdd93bede0072828d6058b7d094 100644 |
| --- a/pkg/front_end/lib/src/fasta/compiler_command_line.dart |
| +++ b/pkg/front_end/lib/src/fasta/compiler_command_line.dart |
| @@ -11,11 +11,15 @@ import 'command_line.dart' show |
| CommandLine, |
| argumentError; |
| +import 'compiler_context.dart' show |
| + CompilerContext; |
| + |
| const Map<String, dynamic> optionSpecification = const <String, dynamic>{ |
| "-o": Uri, |
| "--output": Uri, |
| "--platform": Uri, |
| "--packages": Uri, |
| + "--fatal": ",", |
| }; |
| class CompilerCommandLine extends CommandLine { |
| @@ -65,6 +69,26 @@ class CompilerCommandLine extends CommandLine { |
| ? null |
| : options["--platform"] ?? Uri.base.resolve("platform.dill"); |
| } |
| + |
| + Set<String> get fatal { |
| + return new Set<String>.from(options["--fatal"] ?? <String>[]); |
| + } |
| + |
| + bool get areErrorsFatal => fatal.contains("errors"); |
| + |
| + bool get areWarningsFatal => fatal.contains("warnings"); |
| + |
| + bool get areNitsFatal => fatal.contains("nits"); |
| + |
| + static dynamic withGlobalOptions(String programName, List<String> arguments, |
| + dynamic f(CompilerContext context)) { |
| + return CompilerContext.withGlobalOptions( |
| + new CompilerCommandLine(programName, arguments), f); |
| + } |
| + |
| + static CompilerCommandLine forRootContext() { |
| + return new CompilerCommandLine("", [""]); |
| + } |
| } |
| String computeUsage(String programName, bool verbose) { |
| @@ -140,4 +164,11 @@ Supported options: |
| --compile-sdk |
| Compile the SDK from scratch instead of reading it from 'platform.dill'. |
| + |
| + --fatal=errors |
|
karlklose
2017/02/20 08:06:19
Why not three different flags? Does 'fatal=warning
ahe
2017/02/20 08:47:02
I couldn't find a way to describe it nicely before
|
| + --fatal=warnings |
| + --fatal=nits |
| + Makes messages of the given kinds fatal, that is, immediately stop the |
| + compiler with a non-zero exit-code. In --verbose mode, also display an |
| + internal stack trace from the compiler. |
| """; |