'0 < $ t and $ t < 1000' causes a syntax error
The following IF{...}% causes an error:
Syntax error in '0 < $ t and $ t < 1000' at ' < $ t and $ t < 1000'
%IF{"0 < $ t and $ t < 1000" then="true" else="false"}%
Result: false
%IF{"(0 < $ t) and ($ t < 1000)" then="true" else="false"}%
Result: false
'-1 > 0' is true
The following IF{...} is expanded to true though false is expected.
%IF{"-1 > 0" then="true" else="false"}%
Result: false
--
TWiki:Main/HideyoImazu
- 2013-06-06
Tests:
-
"0 < $ t and $ t < 1000"
: false
-
"0 < $ t"
: false
-
"0 < $ tt"
: false
-
"0 < $ ttt"
: false
-
"0 < 1 and 1 < 1000"
: true
-
"(0 < $ t) AND ($ t < 1000)"
: false
-
"(0 < 1) AND (1 < 1000)"
: true
More tests:
-
"0 > -1"
: true
-
"0 < -1"
: false
-
"0 > 1"
: false
-
"0 < 1"
: true
-
"-1 < 0"
: true
-
"-1 > 0"
: false
-
"1 < 0"
: false
-
"1 > 0"
: true
--
Peter Thoeny - 2013-06-20
Issue with first bug: The parser does not grok single letter variable names.
--
TWiki:Main.PeterThoeny
- 2013-06-20
- IF statement interprets "0" as "undef" instead of a numberic character. In result, all the comparison against "0" is actually comparing with "undef".
- One letter variable name triggers unexpected syntax error is a defect from regex.
--
TWiki:Main.YaojunFei
- 2013-09-06