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

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

Issue 10704180: Use 'int' instead of Position. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 5 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/DartCompilationError.java
diff --git a/compiler/java/com/google/dart/compiler/DartCompilationError.java b/compiler/java/com/google/dart/compiler/DartCompilationError.java
index c77a09dda1afb85be4f8fd8f069cd1653c77bf13..6a01fe60815f9ff9db8c9dc5691480f95fcbad76 100644
--- a/compiler/java/com/google/dart/compiler/DartCompilationError.java
+++ b/compiler/java/com/google/dart/compiler/DartCompilationError.java
@@ -7,7 +7,6 @@ package com.google.dart.compiler;
import com.google.dart.compiler.common.HasSourceInfo;
import com.google.dart.compiler.common.SourceInfo;
import com.google.dart.compiler.parser.DartScanner.Location;
-import com.google.dart.compiler.parser.DartScanner.Position;
/**
* Information about a compilation error.
@@ -109,19 +108,11 @@ public class DartCompilationError {
this.errorCode = errorCode;
this.message = String.format(errorCode.getMessage(), arguments);
if (location != null) {
- Position begin = location.getBegin();
- if (begin != null) {
- offset = begin.getPos();
- lineNumber = begin.getLine();
- columnNumber = begin.getCol();
- }
- Position end = location.getEnd();
- if (end != null) {
- length = end.getPos() - offset;
- if (length < 0) {
- length = 0;
- }
- }
+ offset = location.getBegin();
+ SourceInfo sourceInfo = new SourceInfo(source, offset, 0);
+ lineNumber = sourceInfo.getLine();
+ columnNumber = sourceInfo.getColumn();
+ length = location.getEnd() - offset;
}
}

Powered by Google App Engine
This is Rietveld 408576698