01158: complex, nested conditional markup broken
Description: complex, nested conditions seem to be broken. for instance, this fails:
(:if expr false && (true || false):) expr false && (true || false) succeeds (:ifend:) |
expr false && (true || false) succeeds |
in more realistic expressions though, that general form can succeed. for instance in a page list this works:
if="expr date {(ftime %Y%m%d)}.. {=$:eventtime} && (!equal {=$:nsasevent} no || equal {=$:bigevent} yes)"
but this doesn't:
if="expr (!equal {=$:nsasevent} no || equal {=$:bigevent} yes) && date {(ftime %Y%m%d)}.. {=$:eventtime}"
addenda: actually, that second real example will fail too if the condtions are "(false || false) && true".
(:if expr (false || false) && true:) expr (false || false) && true succeeds (:ifend:) |
expr (false || false) && true succeeds |
The bug essentially comes from the way you're writing the conditional expression: all logical expression token must be white space separated to be taken in account. See below:
(:if expr false && ( true || false ):) expr false && ( true || false ) succeeds (:ifend:) |
(:if expr ( false || false ) && true:) expr ( false || false ) && true succeeds (:ifend:) |
Your realistic expressions should be written like below:
if="expr date {(ftime %Y%m%d)}.. {=$:eventtime} && ( ! equal {=$:nsasevent} no || equal {=$:bigevent} yes )"
but this doesn't:
if="expr ( ! equal {=$:nsasevent} no || equal {=$:bigevent} yes ) && date {(ftime %Y%m%d)}.. {=$:eventtime}"
--Dfaure December 22, 2009, at 02:11 PM
thanks very much for the clarification. i had missed the note saying: "Spaces around operators and brackets are required." would it be a good idea to highlight that somehow in the documentation?
sorry for the false alarm.
/dan - bang December 22, 2009, at 02:40 PM