mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-06 08:47:45 +02:00
[feature/twig] More work on the lexer
Committing what I have now to save it as I'm trying another method next PHPBB3-11598
This commit is contained in:
@@ -21,6 +21,31 @@
|
||||
*/
|
||||
class phpbb_template_twig_tokenparser_event extends Twig_TokenParser_Include
|
||||
{
|
||||
protected function parseArguments()
|
||||
{
|
||||
$stream = $this->parser->getStream();
|
||||
|
||||
$ignoreMissing = true;
|
||||
|
||||
$variables = null;
|
||||
if ($stream->test(Twig_Token::NAME_TYPE, 'with')) {
|
||||
$stream->next();
|
||||
|
||||
$variables = $this->parser->getExpressionParser()->parseExpression();
|
||||
}
|
||||
|
||||
$only = false;
|
||||
if ($stream->test(Twig_Token::NAME_TYPE, 'only')) {
|
||||
$stream->next();
|
||||
|
||||
$only = true;
|
||||
}
|
||||
|
||||
$stream->expect(Twig_Token::BLOCK_END_TYPE);
|
||||
|
||||
return array($variables, $only, $ignoreMissing);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the tag name associated with this token parser.
|
||||
*
|
||||
|
Reference in New Issue
Block a user