summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpaltherr <paltherr@epfl.ch>2004-03-13 17:47:41 +0000
committerpaltherr <paltherr@epfl.ch>2004-03-13 17:47:41 +0000
commitf108d5429fbf1515c0820a327becd5fbd06180f9 (patch)
tree9664a3a1796a6afa479d2894c766730e989f71aa
parent417033fd0a33af000b95623f1c3d0f9e90fbf6ff (diff)
downloadscala-f108d5429fbf1515c0820a327becd5fbd06180f9.tar.gz
scala-f108d5429fbf1515c0820a327becd5fbd06180f9.tar.bz2
scala-f108d5429fbf1515c0820a327becd5fbd06180f9.zip
- Replaced byte array in Name by a string
-rw-r--r--sources/scalac/util/Name.java18
1 files changed, 9 insertions, 9 deletions
diff --git a/sources/scalac/util/Name.java b/sources/scalac/util/Name.java
index 7e22562821..f165ef441c 100644
--- a/sources/scalac/util/Name.java
+++ b/sources/scalac/util/Name.java
@@ -14,7 +14,7 @@ public final class Name {
/** address in the name memory
*/
- public int index;
+ public final int index;
private final String string;
@@ -28,7 +28,7 @@ public final class Name {
/** Constructor
*/
private Name(String string, Name dual) {
- this.string = string;
+ this.string = string;
this.index = dual != null ? dual.index + 1 : 2 * terms.size();
this.term = dual != null ? dual : this;
this.type = dual != null ? this : null;
@@ -62,7 +62,7 @@ public final class Name {
/** return the string representation of this name
*/
public String toString() {
- return string;
+ return string;
}
/** is this name a term name?
@@ -110,19 +110,19 @@ public final class Name {
/** returns first occurrence of char c in this name, -1 if not found
*/
public int indexOf(char c) {
- return indexOf(c, 0);
+ return indexOf(c, 0);
}
/** returns first occurrence of char c in this name from `start', -1 if not found
*/
public int indexOf(char c, int start) {
- return string.indexOf(c, start);
+ return string.indexOf(c, start);
}
/** returns last occurrence of char c in this name, -1 if not found.
*/
public int lastIndexOf(char c) {
- return string.lastIndexOf(c);
+ return string.lastIndexOf(c);
}
/** does this name start with prefix?
@@ -154,9 +154,9 @@ public final class Name {
public boolean isVariable() {
char first = string.charAt(0);
return ((first >= 'a' && first <= 'z') || first == '_') &&
- this != Names.null_ &&
- this != Names.true_ &&
- this != Names.false_;
+ this != Names.null_ &&
+ this != Names.true_ &&
+ this != Names.false_;
}
public static final Name ERROR = Name.fromString("<error>");