Iris icon indicating copy to clipboard operation
Iris copied to clipboard

add boolean expression parser to disable programs

Open fayer3 opened this issue 9 months ago • 3 comments

fixes #1026

adds a boolean expression parser. it might not be the best implementation, but it works from my testing.

the parser uses 2 Stacks, one for operations andone for the parsed values. expressinos are read front to back, and evaluated back to front. brackets and && chains are evaluated once they close/end

fayer3 avatar May 14 '24 22:05 fayer3

There's a important question here; what's stopping JCPP from automatically doing all of this?

IMS212 avatar May 15 '24 18:05 IMS212

jcpp only replaces the options afaik it only evaluates boolen expressions in #ifs

fayer3 avatar May 15 '24 19:05 fayer3

you could maybe do some regex to convert

program.X.enabled=A && B || C

to

#if !(defined A && defined B || defined C)
program.X.enabled=false
#endif

that should then work with jcpp

fayer3 avatar May 15 '24 19:05 fayer3