pico8-ls
pico8-ls copied to clipboard
Formatter removing necessary parentheses in math
I saw some unexpected program behavior after autoformatting, and tracked it down to the formatter removing necessary parentheses in math expressions, which changes the order of operations.
Simple example:
x = 20 - (2 + 3 * 4)
autoformats to:
x = 20 - 2 + 3 * 4
Another example:
x = not (true and false)
Autoformats to the logically different expression:
x = not true and false