List<String> constants = new ArrayList<String>();
while(true){
WeaselCompiler.expect(token, WeaselTokenType.IDENT);
String constantName = (String)token.param;
constants.add(constantName);
WeaselField field = createField(constantName, WeaselModifier.FINAL | WeaselModifier.STATIC | WeaselModifier.PUBLIC, this, new WeaselGenericClassInfo(this, -1, new WeaselGenericClassInfo[0]), ids.staticObjectRef++);
WeaselField[] newFields = new WeaselField[fields.length+1];
for(int i=0; i<fields.length; i++){
newFields[i] = fields[i];
}
newFields[fields.length] = field;
fields = newFields;
WeaselToken nameToken = token;
classStaticInit.add(nameToken);
classStaticInit.add(new WeaselToken(WeaselTokenType.OPERATOR, nameToken.line, WeaselOperator.ASSIGN));
classStaticInit.add(new WeaselToken(WeaselTokenType.KEYWORD, nameToken.line, WeaselKeyWord.NEW));
classStaticInit.add(new WeaselToken(WeaselTokenType.IDENT, nameToken.line, name));
token = getNextToken();
if(token.tokenType==WeaselTokenType.OPENBRACKET){
int count = 0;
classStaticInit.add(token);
token = getNextToken();
while(token.tokenType!=WeaselTokenType.NONE){
classStaticInit.add(token);
if(token.tokenType==WeaselTokenType.OPENBRACKET)
count++;
else if(token.tokenType==WeaselTokenType.CLOSEBRACKET){
if(count<=0)
break;
count--;
}
token = getNextToken();
}
token = getNextToken();
classStaticInit.add(new WeaselToken(WeaselTokenType.SEMICOLON, token.line));
}else{
classStaticInit.add(new WeaselToken(WeaselTokenType.OPENBRACKET, nameToken.line));
classStaticInit.add(new WeaselToken(WeaselTokenType.CLOSEBRACKET, nameToken.line));
classStaticInit.add(new WeaselToken(WeaselTokenType.SEMICOLON, nameToken.line));
}
if(token.tokenType!=WeaselTokenType.COMMA)
break;
token = getNextToken();
}
WeaselField field = createField("values", WeaselModifier.FINAL | WeaselModifier.STATIC | WeaselModifier.PRIVATE, this, new WeaselGenericClassInfo(interpreter.getWeaselClass("["+getByteName()), -1, new WeaselGenericClassInfo[0]), ids.staticObjectRef++);
WeaselField[] newFields = new WeaselField[fields.length+1];
for(int i=0; i<fields.length; i++){
newFields[i] = fields[i];
}
newFields[fields.length] = field;