forked from leftypol/leftypol
Upgrade Twig library
This commit is contained in:
parent
22f3a95e0e
commit
0fe5528574
133 changed files with 5080 additions and 1386 deletions
|
@ -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()
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue