[TwigBundle] Fixed RenderTokenParser when with isn't used and options are provided
This commit is contained in:
parent
ea2cb49696
commit
252918beb2
@ -14,7 +14,7 @@ namespace Symfony\Bundle\TwigBundle\TokenParser;
|
||||
use Symfony\Bundle\TwigBundle\Node\RenderNode;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*
|
||||
* @author Fabien Potencier <fabien.potencier@symfony-project.com>
|
||||
*/
|
||||
@ -35,13 +35,15 @@ class RenderTokenParser extends \Twig_TokenParser
|
||||
if ($this->parser->getStream()->test(\Twig_Token::NAME_TYPE, 'with')) {
|
||||
$this->parser->getStream()->next();
|
||||
|
||||
$hasAttributes = true;
|
||||
$attributes = $this->parser->getExpressionParser()->parseExpression();
|
||||
} else {
|
||||
$hasAttributes = false;
|
||||
$attributes = new \Twig_Node_Expression_Array(array(), $token->getLine());
|
||||
}
|
||||
|
||||
// options
|
||||
if ($this->parser->getStream()->test(\Twig_Token::PUNCTUATION_TYPE, ',')) {
|
||||
if ($hasAttributes && $this->parser->getStream()->test(\Twig_Token::PUNCTUATION_TYPE, ',')) {
|
||||
$this->parser->getStream()->next();
|
||||
|
||||
$options = $this->parser->getExpressionParser()->parseExpression();
|
||||
|
Reference in New Issue
Block a user