ledge icon indicating copy to clipboard operation
ledge copied to clipboard

ESI conditions

Open hamishforbes opened this issue 8 years ago • 0 comments

Creating a PR for this because I think some of these behaviours are wrong.

The ESI spec says...

Logical operators ("&", "|", "!") can be used to qualify expressions, but cannot be used as comparitors themselves. For example, the following expressions are correct:

!(1==1)
!('a'<='c')
(1==1)|('abc'=='def')
(4!=5)&(4==5)

while these will not evaluate:

(1 & 4)
("abc" | "edf")

The condition_lexer will allow those second type of conditions and parse them to Lua.

evaluate_condition also returns non-boolean values for some conditions which seems wrong?

Also some conditions that pass through the lexer result in errors in the evaluator because they are invalid Lua. We should probably try and catch these too.

hamishforbes avatar Sep 05 '17 12:09 hamishforbes