aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/template/twig/tokenparser
diff options
context:
space:
mode:
authorNathan Guse <nathaniel.guse@gmail.com>2013-06-10 10:00:22 -0500
committerNathan Guse <nathaniel.guse@gmail.com>2013-06-10 10:00:22 -0500
commitb775f67128c1c851a2e3343b230d2861e5431528 (patch)
treee8abee32c883eb5fd62c8821b5bb6028fdc0516f /phpBB/includes/template/twig/tokenparser
parent9f8f500ba33963a28c656af8a28a9a6521af4616 (diff)
downloadforums-b775f67128c1c851a2e3343b230d2861e5431528.tar
forums-b775f67128c1c851a2e3343b230d2861e5431528.tar.gz
forums-b775f67128c1c851a2e3343b230d2861e5431528.tar.bz2
forums-b775f67128c1c851a2e3343b230d2861e5431528.tar.xz
forums-b775f67128c1c851a2e3343b230d2861e5431528.zip
[feature/twig] More work on the lexer
Committing what I have now to save it as I'm trying another method next PHPBB3-11598
Diffstat (limited to 'phpBB/includes/template/twig/tokenparser')
-rw-r--r--phpBB/includes/template/twig/tokenparser/event.php25
1 files changed, 25 insertions, 0 deletions
diff --git a/phpBB/includes/template/twig/tokenparser/event.php b/phpBB/includes/template/twig/tokenparser/event.php
index cd211098d6..27a8350af1 100644
--- a/phpBB/includes/template/twig/tokenparser/event.php
+++ b/phpBB/includes/template/twig/tokenparser/event.php
@@ -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.
*