Skip to content
Browse files

fixed wrong node type for the for tag

  • Loading branch information...
1 parent 3e66e3e commit d340339ae02e8c918abb5835e3feaa10137e9e80 @fabpot committed Sep 30, 2011
Showing with 3 additions and 0 deletions.
  1. +3 −0 lib/Twig/TokenParser/For.php
View
3 lib/Twig/TokenParser/For.php
@@ -55,10 +55,13 @@ public function parse(Twig_Token $token)
if (count($targets) > 1) {
$keyTarget = $targets->getNode(0);
+ $keyTarget = new Twig_Node_Expression_AssignName($keyTarget->getAttribute('name'), $keyTarget->getLine());
$valueTarget = $targets->getNode(1);
+ $valueTarget = new Twig_Node_Expression_AssignName($valueTarget->getAttribute('name'), $valueTarget->getLine());
} else {
$keyTarget = new Twig_Node_Expression_AssignName('_key', $lineno);
$valueTarget = $targets->getNode(0);
+ $valueTarget = new Twig_Node_Expression_AssignName($valueTarget->getAttribute('name'), $valueTarget->getLine());
}
return new Twig_Node_For($keyTarget, $valueTarget, $seq, $ifexpr, $body, $else, $lineno, $this->getTag());

0 comments on commit d340339

Please sign in to comment.
Something went wrong with that request. Please try again.