Open NeeEoo opened 3 years ago
We don't have signed numbers
Yea but it still might help to check if the number is negative such as -1. Currently you would do 0-1
0-1 is 255 It is possible to support unary minus sign syntax-wise, but then we would have (-1 == 255) evaluate to true and so on I don't know if it's a desired behavior... What do you think?
The resulting bf code would be [-]-
since the compiler shouldn't assume the cell size.
If i did 5-6
it would become -1
. If it automatically set it to 255 and if the interpreter was 16-bit cells the check would fail.
It would still be that 0-1 == 255
. But for 16-bit interpreters it would be 0-1 == 65535
The compiler shouldn't convert -1
to the literal 255
. It should use wrapping.
Unary Plus is unneeded since it does nothing. Defined as
+NUM
Unary Minus is defined as-NUM
They should not break BINOP.