Template2 icon indicating copy to clipboard operation
Template2 copied to clipboard

Silent parsing failure when passing expressions to a MACRO

Open petdance opened this issue 2 years ago • 0 comments

In this template:

[% MACRO show( n ) BLOCK %]
value="[% n %]"
[% END %]

[%
x=5;
show(x);
show(x+2);
show(x-2);
show(x*2);
show(x/2);
%]

The parser fails on the x/2 line, similar to #314. If I comment out that line, then the x-2 line parses OK, but the incorrect value is passed to the macro:

value="5"

value="7"

value="5"

value="10"

It's like the x-2 passed parsing, but only passed the value of x to the macro. At the very least, the parser should fail is it does in #314, but here it silently passeds the incorrect. alue.

petdance avatar Sep 20 '23 15:09 petdance