Template2
Template2 copied to clipboard
Compiled templates have incorrect line numbers for IF statements
The line numbers in the compiled cache files aren't correct.
For this template:
[% x = 3 %]
[% y = 3 %]
[% IF x == y %]
blah blah
[% END %]
the relevant part of the compiled Perl code is:
eval { BLOCK: {
#line 1 "./sample.ttml"
$stash->set('x', 3);
$output .= '
';
#line 2 "./sample.ttml"
$stash->set('y', 3);
$output .= '
';
#line 5 "./sample.ttml"
if ($stash->get('x') eq $stash->get('y')) {
$output .= '
blah blah
';
}
It shows that the IF statement is on line 5, which is actually the line number of the end of the IF block.