aboutsummaryrefslogtreecommitdiffstats
path: root/bridge
diff options
context:
space:
mode:
authoraclement <aclement>2004-12-10 15:40:59 +0000
committeraclement <aclement>2004-12-10 15:40:59 +0000
commit1575a175b511eadbae03fc760b0cd20edde6ae4e (patch)
treea135e948e9e293df3849b9ab45582125a3dd1590 /bridge
parent379eb69126a1d904c2f4a6a63a97c138a7712791 (diff)
downloadaspectj-1575a175b511eadbae03fc760b0cd20edde6ae4e.tar.gz
aspectj-1575a175b511eadbae03fc760b0cd20edde6ae4e.zip
Support for 'offset' in source locations - enabling AJDT improvements. Not perfect - really the whole ISourceLocation thing needs sorting out ...
Diffstat (limited to 'bridge')
-rw-r--r--bridge/src/org/aspectj/bridge/ISourceLocation.java5
-rw-r--r--bridge/src/org/aspectj/bridge/SourceLocation.java10
2 files changed, 15 insertions, 0 deletions
diff --git a/bridge/src/org/aspectj/bridge/ISourceLocation.java b/bridge/src/org/aspectj/bridge/ISourceLocation.java
index f43a2f54c..ba6d61ee3 100644
--- a/bridge/src/org/aspectj/bridge/ISourceLocation.java
+++ b/bridge/src/org/aspectj/bridge/ISourceLocation.java
@@ -53,6 +53,11 @@ public interface ISourceLocation {
*/
int getColumn();
+ /**
+ * @return offset into file
+ */
+ int getOffset();
+
/** @return getLine()..MAX_LINE */
int getEndLine();
diff --git a/bridge/src/org/aspectj/bridge/SourceLocation.java b/bridge/src/org/aspectj/bridge/SourceLocation.java
index 259fc2067..fecf9041a 100644
--- a/bridge/src/org/aspectj/bridge/SourceLocation.java
+++ b/bridge/src/org/aspectj/bridge/SourceLocation.java
@@ -55,6 +55,7 @@ public class SourceLocation implements ISourceLocation, java.io.Serializable {
private final int startLine;
private final int column;
private final int endLine;
+ private int offset;
private final String context;
private boolean noColumn;
@@ -141,8 +142,17 @@ public class SourceLocation implements ISourceLocation, java.io.Serializable {
if (!noColumn) {
sb.append(":" + column);
}
+ if (offset>=0) {
+ sb.append("::"+offset);
+ }
return sb.toString();
}
+
+ // XXX Ctors for this type should know about an offset, rather than
+ // it being set through these methods - but there are just too many
+ // ctors at the moment! It needs sorting out.
+ public int getOffset() { return offset;}
+ public void setOffset(int i) { offset=i;}
}