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

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

Issue 9113017: Add unitAboutToCompile() into DartCompilerListener (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 12 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: compiler/java/com/google/dart/compiler/DefaultDartCompilerListener.java
diff --git a/compiler/java/com/google/dart/compiler/DefaultDartCompilerListener.java b/compiler/java/com/google/dart/compiler/DefaultDartCompilerListener.java
index 51a6739f2e91d9ea68588010cd5cdf1a2260cf73..7b7be62275a2649c105af78e9bd007c08b5f5ccf 100644
--- a/compiler/java/com/google/dart/compiler/DefaultDartCompilerListener.java
+++ b/compiler/java/com/google/dart/compiler/DefaultDartCompilerListener.java
@@ -13,7 +13,7 @@ import java.io.PrintStream;
* A default implementation of {@link DartCompilerListener} which counts
* compilation errors.
*/
-public class DefaultDartCompilerListener extends DartCompilerListener {
+public class DefaultDartCompilerListener implements DartCompilerListener {
/**
* The number of (fatal) problems that occurred during compilation.
@@ -47,18 +47,6 @@ public class DefaultDartCompilerListener extends DartCompilerListener {
formatter = new PrettyErrorFormatter(outputStream, useColor(), errorFormat);
}
- @Override
- public void onError(DartCompilationError event) {
- formatter.format(event);
- if (event.getErrorCode().getSubSystem() == SubSystem.STATIC_TYPE) {
- incrementTypeErrorCount();
- } else if (event.getErrorCode().getErrorSeverity() == ErrorSeverity.ERROR) {
- incrementErrorCount();
- } else if (event.getErrorCode().getErrorSeverity() == ErrorSeverity.WARNING) {
- incrementWarningCount();
- }
- }
-
private boolean useColor() {
return String.valueOf(System.getenv("TERM")).startsWith("xterm") && System.console() != null;
}
@@ -112,6 +100,22 @@ public class DefaultDartCompilerListener extends DartCompilerListener {
}
@Override
+ public void onError(DartCompilationError event) {
+ formatter.format(event);
+ if (event.getErrorCode().getSubSystem() == SubSystem.STATIC_TYPE) {
+ incrementTypeErrorCount();
+ } else if (event.getErrorCode().getErrorSeverity() == ErrorSeverity.ERROR) {
+ incrementErrorCount();
+ } else if (event.getErrorCode().getErrorSeverity() == ErrorSeverity.WARNING) {
+ incrementWarningCount();
+ }
+ }
+
+ @Override
+ public void unitAboutToCompile(DartSource source, boolean diet) {
+ }
+
+ @Override
public void unitCompiled(DartUnit unit) {
}
}

Powered by Google App Engine
This is Rietveld 408576698