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)); |
- } |
} |