use of com.mitchellbosecke.pebble.node.expression.FilterExpression in project Orchid by JavaEden.
the class BaseTagParser method parseBody.
protected Expression<?> parseBody(List<Expression<?>> filterInvocationExpressions, String bodyTagName, TokenStream stream, Parser parser) throws ParserException {
BodyNode body = parser.subparse(token -> token.test(Token.Type.NAME, "end" + bodyTagName));
stream.next();
stream.expect(Token.Type.EXECUTE_END);
Expression<?> lastExpression = new RenderableNodeExpression(body, stream.current().getLineNumber());
for (Expression<?> filterInvocationExpression : filterInvocationExpressions) {
FilterExpression filterExpression = new FilterExpression();
filterExpression.setRight(filterInvocationExpression);
filterExpression.setLeft(lastExpression);
lastExpression = filterExpression;
}
return lastExpression;
}
Aggregations