/** * Parse next filter token. * * @return FilterNode */ protected function parseFilter() { $block = null; $token = $this->expectTokenType('filter'); $attributes = $this->acceptTokenType('attributes'); if ('text' === $this->lexer->predictToken(2)->type) { $block = $this->parseTextBlock(); } else { $block = $this->parseBlock(); } $node = new FilterNode($token->value, null !== $attributes ? $attributes->attributes : array(), $this->lexer->getCurrentLine()); $node->setBlock($block); return $node; }