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

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

Issue 8348015: Improve location information for some warnings/errors. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' 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
===================================================================
--- compiler/java/com/google/dart/compiler/parser/AbstractParser.java (revision 512)
+++ compiler/java/com/google/dart/compiler/parser/AbstractParser.java (working copy)
@@ -8,7 +8,6 @@
import com.google.dart.compiler.DartCompilerErrorCode;
import com.google.dart.compiler.ErrorCode;
import com.google.dart.compiler.ast.DartNode;
-import com.google.dart.compiler.parser.DartScanner.Location;
/**
* Abstract base class for sharing common utility methods between implementation
@@ -91,13 +90,13 @@
*/
protected void reportError(DartScanner.Position position, ErrorCode errorCode,
Object... arguments) {
- DartCompilationError dartError = new DartCompilationError(ctx.getTokenLocation(), errorCode,
- arguments);
- if (dartError.getStartPosition() <= lastErrorPosition) {
+ DartScanner.Location location = ctx.getTokenLocation();
+ if (location.getBegin().getPos() <= lastErrorPosition) {
return;
}
+ DartCompilationError dartError = new DartCompilationError(ctx.getSource(), location, errorCode,
+ arguments);
lastErrorPosition = position.getPos();
- dartError.setSource(ctx.getSource());
ctx.error(dartError);
}
@@ -129,8 +128,4 @@
next();
return result;
}
-
- public void error(Location location, DartCompilerErrorCode code, Object... arguments) {
- ctx.error(new DartCompilationError(location, code, arguments));
- }
}

Powered by Google App Engine
This is Rietveld 408576698