Token lastToken;
for (int i = 0; i < chars.length; i++) {
char c = chars[i];
+
if (c == ' ')
continue;
if (isDigit(c)) {
}
i += numberLen - 1;
lastToken = new NumberToken(valueBuilder.toString());
- } else if (Character.isLetter(c) || c == '_' || c == '#') {
+ } else if (Character.isLetter(c) || c == '_' || c == '$') {
// can be a variable or function
final StringBuilder nameBuilder = new StringBuilder();
nameBuilder.append(c);
int offset = 1;
- while (chars.length > i + offset && (Character.isLetter(chars[i + offset]) || Character.isDigit(chars[i + offset]) || chars[i + offset] == '_' || chars[i + offset] == '#')) {
+ while (chars.length > i + offset && (Character.isLetter(chars[i + offset]) || Character.isDigit(chars[i + offset]) || chars[i + offset] == '_' || chars[i + offset] == '$')) {
nameBuilder.append(chars[i + offset++]);
}
String name = nameBuilder.toString();
return false;
// No bad characters
- for (char c : "0123456789.,()[]{}<>:#@%^&* ".toCharArray())
+ for (char c : "0123456789.,()[]{}<>:#@%^&*$ ".toCharArray())
if (symbol.indexOf(c) != -1 )
return false;
return false;
// No characters that could mess things up saving etc
- for (char c : ",()[]{}<>#".toCharArray())
+ for (char c : ",()[]{}<>#$".toCharArray())
if (name.indexOf(c) != -1 )
return false;
}
else break;
case '#' : return false;
+ case '$' : return false;
case '=' : return false;
}
}
}
/*
- * Returns a simple all upper case string hash code with a proceeding # mark.
+ * Returns a simple all upper case string hash code with a proceeding $ mark.
* Used for temporary substitution when evaluating index and range expressions.
*/
public String hash(){
Integer hashint = new Integer(this.getExpressionString().hashCode());
- String hash = "#";
+ String hash = "$";
for (char c : hashint.toString().toCharArray()){
char newc = (char) (c + 17);
hash = hash + newc;