}
@Override
public void doExecute(ExpressionContext context, TagNode tag, Writer out) throws TemplateEvaluationException, IOException {
try {
Iter iter = new Iter();
for (int i = from.asInt(context); i <= to.asInt(context); i++) {
if (i == to.asInt(context))
iter.setLast();
context.put(Expressions.CURRENT_OBJECT, i);
context.put(Expressions.ITER_OBJECT, iter);
tag.execute(context, out);
iter.next();
}
} catch (ExpressionEvaluationException e) {
throw new TemplateEvaluationException(e, "Could not execute the expression: " + e.getMessage() +
", on line: " + tag.getBeginLine() + ", column: " + tag.getBeginColumn(),
tag.getBeginLine(), tag.getBeginColumn(), tag.getTagName());