1
0
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:
Nathan Guse
2013-06-10 10:00:22 -05:00
parent 9f8f500ba3
commit b775f67128
3 changed files with 41 additions and 2 deletions

View File

@@ -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.
*