diff options
| author | czaks <marcin@6irc.net> | 2013-08-05 06:03:40 -0400 |
|---|---|---|
| committer | czaks <marcin@6irc.net> | 2013-08-05 06:03:40 -0400 |
| commit | a84c4510fccfdc0cfb6f187633daea10dc70f326 (patch) | |
| tree | 6077f5211196ae40cac0184bb7cc67b81d320b0b /inc/lib/Twig/TokenParser/Use.php | |
| parent | 33c7abf11f3a9b5c0964a2d7a25533c2849dbc78 (diff) | |
| parent | a8327c3a37fd22d2aa5d63061c9d3eaa30ae425a (diff) | |
Merge branch 'master' of github.com:vichan-devel/Tinyboard
Conflicts:
js/post-hider.js
Diffstat (limited to 'inc/lib/Twig/TokenParser/Use.php')
| -rw-r--r-- | inc/lib/Twig/TokenParser/Use.php | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/inc/lib/Twig/TokenParser/Use.php b/inc/lib/Twig/TokenParser/Use.php index 16c47e3e..bc0e09ef 100644 --- a/inc/lib/Twig/TokenParser/Use.php +++ b/inc/lib/Twig/TokenParser/Use.php @@ -35,13 +35,12 @@ class Twig_TokenParser_Use extends Twig_TokenParser public function parse(Twig_Token $token) { $template = $this->parser->getExpressionParser()->parseExpression(); + $stream = $this->parser->getStream(); if (!$template instanceof Twig_Node_Expression_Constant) { - throw new Twig_Error_Syntax('The template references in a "use" statement must be a string.', $token->getLine()); + throw new Twig_Error_Syntax('The template references in a "use" statement must be a string.', $stream->getCurrent()->getLine(), $stream->getFilename()); } - $stream = $this->parser->getStream(); - $targets = array(); if ($stream->test('with')) { $stream->next(); @@ -69,14 +68,12 @@ class Twig_TokenParser_Use extends Twig_TokenParser $stream->expect(Twig_Token::BLOCK_END_TYPE); $this->parser->addTrait(new Twig_Node(array('template' => $template, 'targets' => new Twig_Node($targets)))); - - return null; } /** * Gets the tag name associated with this token parser. * - * @param string The tag name + * @return string The tag name */ public function getTag() { |
