summaryrefslogtreecommitdiff
path: root/inc/lib/Twig/TokenParser/Use.php
diff options
context:
space:
mode:
authorMichael Foster <savetheinternet@tinyboard.org>2013-08-01 15:20:12 -0400
committerMichael Foster <savetheinternet@tinyboard.org>2013-08-01 15:20:12 -0400
commit0fe552857468aa12097a74e08f51f5aaa983be07 (patch)
tree22dbca1be90d7086b20a077752552296abf23325 /inc/lib/Twig/TokenParser/Use.php
parent22f3a95e0e421de05a11633eac846df96a2a4768 (diff)
Upgrade Twig library
Diffstat (limited to 'inc/lib/Twig/TokenParser/Use.php')
-rw-r--r--inc/lib/Twig/TokenParser/Use.php9
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()
{