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

Side by Side Diff: compiler/java/com/google/dart/compiler/DefaultErrorFormatter.java

Issue 8476005: Support for --machine-problems, tests for PrettyErrorFormatter (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 9 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 package com.google.dart.compiler; 5 package com.google.dart.compiler;
6 6
7 import java.io.PrintStream; 7 import java.io.PrintStream;
8 8
9 /** 9 /**
10 * An error formatter that simply prints the file name with the line and column 10 * An error formatter that simply prints the file name with the line and column
11 * location. 11 * location.
12 */ 12 */
13 public class DefaultErrorFormatter implements ErrorFormatter { 13 public class DefaultErrorFormatter implements ErrorFormatter {
14 protected PrintStream outputStream = System.err; 14 protected final PrintStream outputStream;
15 15
16 public void setOutputStream(PrintStream outputStream) { 16 public DefaultErrorFormatter(PrintStream outputStream) {
17 this.outputStream = outputStream; 17 this.outputStream = outputStream;
18 } 18 }
19 19
20 @Override 20 @Override
21 public void format(DartCompilationError event) { 21 public void format(DartCompilationError event) {
22 outputStream.printf("%s:%d:%d: %s\n", 22 outputStream.printf("%s:%d:%d: %s\n",
23 (event.getSource() != null) 23 (event.getSource() != null)
24 ? event.getSource().getName() : "<unknown-source-file>", 24 ? event.getSource().getName() : "<unknown-source-file>",
25 event.getLineNumber(), 25 event.getLineNumber(),
26 event.getColumnNumber(), 26 event.getColumnNumber(),
27 event.getMessage()); 27 event.getMessage());
28 } 28 }
29 } 29 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698