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

Unified Diff: compiler/java/com/google/dart/compiler/parser/AbstractParser.java

Issue 8395013: DartC User Warning Framework (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Use new ErrorCode enums in single onError() method. Created 9 years, 2 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/parser/AbstractParser.java
diff --git a/compiler/java/com/google/dart/compiler/parser/AbstractParser.java b/compiler/java/com/google/dart/compiler/parser/AbstractParser.java
index 3b6b9554b2ee02a073ecedc18a408214ccd03f46..4805bc76b935162bf09b9faa26c6ca5c23767bcd 100644
--- a/compiler/java/com/google/dart/compiler/parser/AbstractParser.java
+++ b/compiler/java/com/google/dart/compiler/parser/AbstractParser.java
@@ -5,9 +5,7 @@
package com.google.dart.compiler.parser;
import com.google.dart.compiler.DartCompilationError;
-import com.google.dart.compiler.DartCompilerErrorCode;
import com.google.dart.compiler.ErrorCode;
-import com.google.dart.compiler.ast.DartNode;
/**
* Abstract base class for sharing common utility methods between implementation
@@ -100,20 +98,14 @@ abstract class AbstractParser {
ctx.error(dartError);
}
- protected void reportWarning(DartNode node, ErrorCode errorCode, Object... arguments) {
- DartCompilationError dartError = new DartCompilationError(node, errorCode, arguments);
- dartError.setSource(ctx.getSource());
- ctx.warning(dartError);
- }
-
protected void reportUnexpectedToken(DartScanner.Position position, Token expected,
Token actual) {
if (expected == Token.EOS) {
- reportError(position, DartCompilerErrorCode.EXPECTED_EOS, actual);
+ reportError(position, ParserErrorCode.EXPECTED_EOS, actual);
} else if (expected == null) {
- reportError(position, DartCompilerErrorCode.UNEXPECTED_TOKEN, actual);
+ reportError(position, ParserErrorCode.UNEXPECTED_TOKEN, actual);
} else {
- reportError(position, DartCompilerErrorCode.EXPECTED_TOKEN, actual, expected);
+ reportError(position, ParserErrorCode.EXPECTED_TOKEN, actual, expected);
}
}

Powered by Google App Engine
This is Rietveld 408576698