diff options
Diffstat (limited to 'st/TokenKey.java')
-rw-r--r-- | st/TokenKey.java | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/st/TokenKey.java b/st/TokenKey.java index 2319917..54086c5 100644 --- a/st/TokenKey.java +++ b/st/TokenKey.java @@ -8,18 +8,20 @@ package st; public class TokenKey { private String name; - private int beginLine; + private AbstractInstance cls; // null for classes + private AbstractInstance mtd; // null for classes, methods - public TokenKey(String name, int beginLine) { - // classes CANNOT collide, so CALLEES ARE EXPECTED TO USE ZERO! + public TokenKey(String name, AbstractInstance cls, AbstractInstance mtd) { this.name = name; - this.beginLine = beginLine; + this.cls = cls; + this.mtd = mtd; } @Override public String toString() { - return String.format("%s (%d)", + return String.format("%s (%s,%s)", this.name, - this.beginLine); + this.mtd, + this.cls); } @@ -28,7 +30,8 @@ public class TokenKey { TokenKey o; if (other instanceof TokenKey && (o = (TokenKey) other).name == this.name && - o.beginLine == this.beginLine) { + o.cls == this.cls && + o.mtd == this.mtd) { ret = true; } return ret; |