Upgrade Twig library
This commit is contained in:
@@ -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()
|
||||
{
|
||||
|
Reference in New Issue
Block a user