mirror of
https://github.com/twigphp/Twig.git
synced 2026-08-31 20:47:28 +00:00
Use correct lineno for ForElseNode
It should take the line number of the `{% else %}` block.
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