hoaproject/Ruler

Incorrect condition on disassembly

julban opened this issue · 3 comments

Hi all,

There is a problem in Disassembly class on the isToken condition.
Instead of adding parenthesis when using not, and, or, xor , it adds parenthesis on other operators.
Example:

  • the rule I write and I expect to get after interpreting it, getting the Model and then disassembling it:
((age > 50 and civility = 'mr') or (age < 40 and civility = 'mrs'))
  • the rule I currently get with hoa/ruler in version 1.15.11.09 :
(age > 50) and (civility = 'mr') or (age < 40) and (civility = 'mrs')

I guess that the isToken condition , instead of being compared to false, should be compared to true.
Modifying this condition this way, I get the expected result.

Thanks in advance :-)

Hywan commented

Hello!

Nice one :-). Are you able to write a PR?

Good catch. :)

Thanks, I'll do a PR next week unless someone needs it before, anyone's free to do it so.