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

Unified Diff: compiler/java/com/google/dart/compiler/CommandLineOptions.java

Issue 8949055: Issue 250: Allow for GNU formatted errors (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Tweaks to drop 'gnu' and stuff library in message format Created 9 years 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: compiler/java/com/google/dart/compiler/CommandLineOptions.java
diff --git a/compiler/java/com/google/dart/compiler/CommandLineOptions.java b/compiler/java/com/google/dart/compiler/CommandLineOptions.java
index 6f5aa4fdd23ed4f943cdf173aee4e0c8c0b9dce9..2cb970b56e36588c3aa973bd26a5615bb89ec4f3 100644
--- a/compiler/java/com/google/dart/compiler/CommandLineOptions.java
+++ b/compiler/java/com/google/dart/compiler/CommandLineOptions.java
@@ -5,6 +5,7 @@
package com.google.dart.compiler;
import com.google.common.collect.Lists;
+import com.google.dart.compiler.CompilerConfiguration.ErrorFormat;
import com.google.dart.runner.DartRunner;
import com.google.dart.runner.RunnerOptions;
@@ -41,9 +42,9 @@ public class CommandLineOptions {
@Option(name = "--expose_core_impl", usage = "Automatic import of dart:coreimpl library")
private boolean exposeCoreImpl = false;
- @Option(name = "--machine-problems",
- usage = "Format errors for machine parsing")
- private boolean printMachineProblems = false;
+ @Option(name = "--error_format",
+ usage = "Format errors as normal, machine, or GNU")
zundel 2011/12/22 15:32:31 remove gnu
codefu 2011/12/22 15:38:20 Done.
+ private String errorFormat = "";
@Option(name = "--enable_type_checks",
usage = "Generate runtime type checks")
@@ -294,14 +295,6 @@ public class CommandLineOptions {
}
/**
- * Returns <code>true</code> if the compiler should print compilation problems in machine
- * format, with all information - severity, subsystem, etc.
- */
- public boolean printMachineProblems() {
- return printMachineProblems;
- }
-
- /**
* Returns whether type errors are fatal.
*/
public boolean typeErrorsAreFatal() {
@@ -318,6 +311,17 @@ public class CommandLineOptions {
public boolean developerModeChecks() {
return developerModeChecks;
}
+
+ /**
+ * @return the format to use for printing errors
+ */
+ public ErrorFormat printErrorFormat() {
+ String lowerError = errorFormat.toLowerCase();
+ if ("machine".equals(lowerError)) {
+ return ErrorFormat.MACHINE;
+ }
+ return ErrorFormat.NORMAL;
+ }
}
/**

Powered by Google App Engine
This is Rietveld 408576698