Chromium Code Reviews| 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; |
| + } |
| } |
| /** |