return variable;
}
@Override
public XQExpression visit(VarRef ref, XQueryContext ctxt) throws XQueryException {
Variable var = ref.getValue();
if(var instanceof PathVariable) {
visit((PathVariable) var, ctxt);
} else if(var instanceof ParametricVariable) {
XQExpression expr = ((ParametricVariable) var).getValue();
if(expr == null) {
buf.append(var);
} else {
visit(expr, ctxt);
}
} else if(var instanceof ThreadedVariable) {
ThreadedVariable threadVar = (ThreadedVariable) var;
buf.append(threadVar);
buf.append(" := ");
indentln();
XQExpression expr = threadVar.getValue();
assert (expr != null);
visit(expr, ctxt);
indent--;
} else if(var instanceof ShippedVariable) {
buf.append(var.getValue());
} else {
buf.append(var);
}
return ref;
}