public void caseASetCommand(ASetCommand node) {
setLastPosition(node.getPosition());
String variableName = variableLocator.getVariableName(node.getVariable());
try {
Data variable = dataContext.findVariable(variableName, true);
Value value = expressionEvaluator.evaluate(node.getExpression());
variable.setValue(value.asString());
// TODO: what about nested structures?
// "set" was used to set a variable to a constant or escaped value like
// <?cs set: x = "<b>X</b>" ?> or <?cs set: y = html_escape(x) ?>
// Keep track of this so autoescaping code can take it into account.
variable.setEscapeMode(value.getEscapeMode());
} catch (UnsupportedOperationException e) {
// An error occurred - probably due to trying to modify an UnmodifiableData
throw new UnsupportedOperationException(createUnsupportedOperationMessage(node, context
.getIncludedTemplateNames()), e);
}