The readme text for ASM6 says that the unary '-' operator has the second highest precedence (below only parantheses), but the program itself gives it the lowest precedence. When the unary '-' operator is processed, it is given a precedence of WHOLE_EXP, which is the lowest precedence in the program. Indeed, with tests, I have seen that a statement such as:
-5 + 3 * 9
is processed as though it were written:
-(5 + 3 * 9)
when, suggesting from the readme, it should be instead processed as though it were written:
(-5) + 3 * 9
Which yield two different results. It seems that every unary operator in ASM6 has this error. This would be easy to fix by adding a new precedence type higher than MULDIV, such as UNARY. Perhaps we can easily fix this?
-5 + 3 * 9
is processed as though it were written:
-(5 + 3 * 9)
when, suggesting from the readme, it should be instead processed as though it were written:
(-5) + 3 * 9
Which yield two different results. It seems that every unary operator in ASM6 has this error. This would be easy to fix by adding a new precedence type higher than MULDIV, such as UNARY. Perhaps we can easily fix this?