Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiled templates have incorrect line numbers for IF statements #306

Open
petdance opened this issue Feb 8, 2023 · 0 comments
Open

Compiled templates have incorrect line numbers for IF statements #306

petdance opened this issue Feb 8, 2023 · 0 comments

Comments

@petdance
Copy link
Contributor

petdance commented Feb 8, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant