lep/jhcr

incorrect JASS operator precedence in generated script file

Closed this issue · 1 comments

shuen4 commented
// input
if not false and true then
    call BJDebugMsg("test")
endif

// generate (incorrect)
if (not (false and true)) then
    call BJDebugMsg ("test")
endif
// input
if (not false) and true then
    call BJDebugMsg("test")
endif

// generate (correct)
if ((not false) and true) then
    call BJDebugMsg ("test")
endif
// input
if not false and false then
    call BJDebugMsg("test")
endif

// generate (incorrect)
if (not (false and false)) then
    call BJDebugMsg ("test")
endif
// input
if (not false) and false then
    call BJDebugMsg("test")
endif

// generate (correct)
if ((not false) and false) then
    call BJDebugMsg ("test")
endif

result:
input - 1st and 2nd will run if block
generated - 1st to 3rd will run if block

lep commented

Thanks. Should be fixed in affd6b5
Feel free to test unary plus and minus aswell 😄