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

Unified Diff: pkg/front_end/lib/src/fasta/compiler_command_line.dart

Issue 2977013002: Report messages instead of just printing. (Closed)
Patch Set: Update expectations. Created 3 years, 5 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 04a4b6c68ae8aee16f616cdd3aff285a5b3190ff..c4c4fd9d28bdef7c958c6fa1833a03e65be83929 100644
--- a/pkg/front_end/lib/src/fasta/compiler_command_line.dart
+++ b/pkg/front_end/lib/src/fasta/compiler_command_line.dart
@@ -6,20 +6,25 @@ library fasta.compiler_command_line;
import 'dart:io' show exit;
+import 'package:kernel/target/targets.dart'
+ show Target, getTarget, TargetFlags, targets;
+
import 'command_line.dart' show CommandLine, deprecated_argumentError;
import 'compiler_context.dart' show CompilerContext;
-import 'package:kernel/target/targets.dart'
- show Target, getTarget, TargetFlags, targets;
+import 'command_line_reporting.dart' as command_line_reporting;
import 'fasta_codes.dart'
show
+ LocatedMessage,
Message,
messageFastaUsageLong,
messageFastaUsageShort,
templateUnspecified;
+import 'severity.dart' show Severity;
+
const Map<String, dynamic> optionSpecification = const <String, dynamic>{
"--compile-sdk": Uri,
"--fatal": ",",
@@ -128,6 +133,24 @@ class CompilerCommandLine extends CommandLine {
Target get target => options["target"];
+ void Function(LocatedMessage, Severity) get report {
+ return options["report"] ?? command_line_reporting.report;
+ }
+
+ void Function(Message, Severity) get reportWithoutLocation {
+ return options["reportWithoutLocation"] ??
+ command_line_reporting.reportWithoutLocation;
+ }
+
+ String Function(LocatedMessage, Severity) get format {
+ return options["format"] ?? command_line_reporting.format;
+ }
+
+ String Function(Message, Severity) get formatWithoutLocation {
+ return options["formatWithoutLocation"] ??
+ command_line_reporting.formatWithoutLocation;
+ }
+
static dynamic withGlobalOptions(String programName, List<String> arguments,
dynamic f(CompilerContext context)) {
return CompilerContext.withGlobalOptions(

Powered by Google App Engine
This is Rietveld 408576698