| Index: compiler/java/com/google/dart/compiler/PrettyErrorFormatter.java
|
| diff --git a/compiler/java/com/google/dart/compiler/PrettyErrorFormatter.java b/compiler/java/com/google/dart/compiler/PrettyErrorFormatter.java
|
| index f8ac492f35abbe98ae49f486d2b6f5f70df25eae..21d6c21d0ace52c570fa4b58fe16c4fbb375d188 100644
|
| --- a/compiler/java/com/google/dart/compiler/PrettyErrorFormatter.java
|
| +++ b/compiler/java/com/google/dart/compiler/PrettyErrorFormatter.java
|
| @@ -87,15 +87,15 @@ public class PrettyErrorFormatter extends DefaultErrorFormatter {
|
| }
|
| if (errorFormat == ErrorFormat.MACHINE) {
|
| buf.append(String.format(
|
| - "%s:%s:%s:%s:%d:%d:%d: %s",
|
| - event.getErrorCode().getErrorSeverity(),
|
| - event.getErrorCode().getSubSystem(),
|
| - event.getErrorCode(),
|
| - sourceFile.getName(),
|
| + "%s|%s|%s|%s|%d|%d|%d|%s",
|
| + escapePipe(event.getErrorCode().getErrorSeverity().toString()),
|
| + escapePipe(event.getErrorCode().getSubSystem().toString()),
|
| + escapePipe(event.getErrorCode().toString()),
|
| + escapePipe(sourceFile.getName()),
|
| event.getLineNumber(),
|
| 1 + col,
|
| length,
|
| - event.getMessage()));
|
| + escapePipe(event.getMessage())));
|
| } else {
|
| String sourceName = sourceFile.getUri().toString();
|
| String includeFrom = getImportString(sourceFile);
|
| @@ -154,6 +154,17 @@ public class PrettyErrorFormatter extends DefaultErrorFormatter {
|
| }
|
| }
|
|
|
| + private String escapePipe(String input) {
|
| + StringBuilder result = new StringBuilder();
|
| + for (char c : input.toCharArray()) {
|
| + if (c == '\\' || c == '|') {
|
| + result.append('\\');
|
| + }
|
| + result.append(c);
|
| + }
|
| + return result.toString();
|
| + }
|
| +
|
| private String getLineAt(BufferedReader reader, int line) throws IOException {
|
| if (line <= 0) {
|
| return null;
|
|
|