Template2
Template2 copied to clipboard
Document the parsing rules for arithmetic expressions
It seems that TT requires spaces around math operators sometimes. For example this runs just fine:
x = 5;
y = x + 2; ' y='; y;
y = x - 2; ' y='; y;
y = x * 2; ' y='; y;
y = x / 2; ' y='; y;
and gives
y=7 y=3 y=10 y=2.5
However, this fails parsing:
x = 5;
y = x+2; ' y='; y;
y = x-2; ' y='; y;
y = x*2; ' y='; y;
y = x/2; ' y='; y;
on the x-2. Comment that line out, and it also fails on the x/2.
If it's documented somewhere that x-2 is not valid but x - 2 is, I can't find it.