3 namespace DrupalCodeGenerator\Twig;
9 * A class that defines the Twig 'sort' token parser.
11 class TwigSortTokenParser extends Twig_TokenParser {
16 public function parse(Twig_Token $token) {
18 $this->parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE);
19 $body = $this->parser->subparse(
20 function (Twig_Token $token) {
21 return $token->test('endsort');
25 $this->parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE);
27 return new TwigSortSetNode(['body' => $body], [], $token->getLine(), $this->getTag());
33 public function getTag() {