mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-01 21:17:21 +00:00
bug #4572 Use correct lineno for ForElseNode (ruudk)
This PR was merged into the 3.x branch.
Discussion
----------
Use correct lineno for ForElseNode
It should take the line number of the `{% else %}` block.
Commits
-------
a84e602b4f Use correct lineno for ForElseNode
This commit is contained in:
@@ -42,8 +42,9 @@ final class ForTokenParser extends AbstractTokenParser
|
||||
$stream->expect(Token::BLOCK_END_TYPE);
|
||||
$body = $this->parser->subparse([$this, 'decideForFork']);
|
||||
if ('else' == $stream->next()->getValue()) {
|
||||
$elseLineno = $stream->getCurrent()->getLine();
|
||||
$stream->expect(Token::BLOCK_END_TYPE);
|
||||
$else = new ForElseNode($this->parser->subparse([$this, 'decideForEnd'], true), $stream->getCurrent()->getLine());
|
||||
$else = new ForElseNode($this->parser->subparse([$this, 'decideForEnd'], true), $elseLineno);
|
||||
} else {
|
||||
$else = null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user