// This test relies on the sequence optimizer removing single element
// sequence commands.
if (expression instanceof AFunctionExpression) {
// Replace: <?cs var:foo_escape(x) ?>
// with: <?cs escape:"foo" ?><?cs var:x ?><?cs /escape ?>
AFunctionExpression functionExpression = (AFunctionExpression) expression;
String name = escapeNameOf(functionExpression);
if (escaperNames.contains(name)) {
LinkedList<PExpression> args = functionExpression.getArgs();
if (args.size() == 1) {
return new AEscapeCommand(position, quotedStringExpressionOf(name),
optimizedVarCommandOf(position, args.getFirst()));
}
}