}
localContext.setLocalVariables(populatedArguments);
}
public void populateDataArguments(List<Data> arguments) {
MapContext populatedArguments = new MapContext(name, namespaces, templateTextWriter);
Iterator<Data> argumentsIterator = arguments.iterator();
for (String parameter : parameters) {
if (!argumentsIterator.hasNext()) {
throw new InterpretationException(source, indexInSource, "Missing argument in parameter list for macro '" + name + "'");
}
Data argument = argumentsIterator.next();
if (argument.isLazy()) {
populatedArguments.set(parameter, argument);
} else {
populatedArguments.set(parameter, argument.evaluate());
}
}
if (argumentsIterator.hasNext()) {
throw new InterpretationException(source, indexInSource, "Too many arguments in parameter list for macro '" + name + "'");
}