diff options
Diffstat (limited to 'st/TokenKey.java')
-rw-r--r-- | st/TokenKey.java | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/st/TokenKey.java b/st/TokenKey.java index 948e06a..a421c95 100644 --- a/st/TokenKey.java +++ b/st/TokenKey.java @@ -10,18 +10,21 @@ import misc.*; public class TokenKey { private String name; + private TypeEnum type; private AbstractInstance cls; // null for classes private AbstractInstance mtd; // null for classes, methods - public TokenKey(String name, AbstractInstance cls, AbstractInstance mtd) { + public TokenKey(String name, TypeEnum type, AbstractInstance cls, AbstractInstance mtd) { this.name = name; + this.type = type; this.cls = cls; this.mtd = mtd; } @Override public String toString() { - return String.format("%s (%s,%s)", + return String.format("%s of %s (%s,%s)", this.name, + this.type, this.mtd, this.cls); } @@ -47,6 +50,8 @@ public class TokenKey { // } if (other instanceof TokenKey && (o = (TokenKey) other).name.equals(this.name) && + ((o.type == null && this.type == null) || + (o.type != null && o.type.equals(this.type))) && ((o.cls == null && this.cls == null) || (o.cls != null && o.cls.equals(this.cls))) && ((o.mtd == null && this.mtd == null) || |