QB64-Phoenix-Edition / QB64pe

The QB64 Phoenix Edition Repository
https://qb64phoenix.com
Other
132 stars 26 forks source link

`X ^ -NOT Y` is considered invalid syntax #23

Open mkilgore opened 2 years ago

mkilgore commented 2 years ago

X ^ -NOT Y is valid syntax in QB45, but gives a syntax error in QB64 due to it not understanding the NOT operator can come after - within exponentiation (It thinks there has to be a number). It does correctly understand X ^ NOT Y and X ^ - Y, so it's just the combination negating the NOT that confuses the parser. The opposite X ^ NOT -Y is seemly parsed correctly.

RhoSigma-QB64 commented 1 year ago

It works as X ^ (-NOT Y) which is at least compliant to the Wiki (works that way already in old SDL versions). Just stumbled over this while checking/cleaning/fancy things, those notes are in there for ages, but probably forgotten even by the former developers. They just noticed negative exponents didn't work and tried to fixed it so things like X ^ -Y work now without paranthesis. But the fix isn't complete.