public static Object compute(String varString, JangodInterpreter interpreter) throws InterpretException {
if ( ( varString.startsWith(Constants.STR_SINGLE_QUOTE) &&varString.endsWith(Constants.STR_SINGLE_QUOTE) ) ||
( varString.startsWith(Constants.STR_DOUBLE_QUOTE) && varString.endsWith(Constants.STR_DOUBLE_QUOTE) ) ) {
return varString.substring(1, varString.length()-1);
}
FilterParser fp = new FilterParser(varString);
try {
fp.parse();
} catch (ParseException e) {
throw new InterpretException(e.getMessage());
}
Object var = interpreter.retraceVariable(fp.getVariable());
List<String> filters = fp.getFilters();
if ( filters.isEmpty() ) {
return var;
}
List<String[]> argss = fp.getArgss();
String[] args;
Filter filter;
for(int i=0; i<filters.size(); i++) {
filter = FilterLibrary.getFilter(filters.get(i));
if ( filter == null ) {