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

Unified Diff: pkg/front_end/lib/src/fasta/compiler_command_line.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/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..6cd3478b5a55551070d955dd4e0107010d879887 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,12 @@ Supported options:
--compile-sdk
Compile the SDK from scratch instead of reading it from 'platform.dill'.
+
+ --fatal=errors
+ --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. Multiple kinds can be separated by
+ commas, for example, --fatal=errors,warnings.
""";
« no previous file with comments | « pkg/front_end/lib/src/fasta/builder/prefix_builder.dart ('k') | pkg/front_end/lib/src/fasta/compiler_context.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698