UndertaleModTool
UndertaleModTool copied to clipboard
Decompiler parenthesis cleanup
Description
Attempt to severely reduce the number of parentheses produced by the decompiler, especially when handling math and comparison expressions.
Caveats
Each aspect has been tested, but I could be missing complex order-of-operations edge cases where the removed parentheses are required. I think that in that event, it's still preferable to handle those cases as they arise rather than continue with the current state.
Notes
I may re-add decompiler rounding (numbers like 0.2 currently decompile as 0.20000000000000001 due to floating-point restrictions) to this branch later.
Fixes #1032
Download the artifacts for this pull request here:
GUI:
- GUI-windows-latest-isBundled-false-isSingleFile-true
- GUI-windows-latest-isBundled-false-isSingleFile-false
CLI:
This seems to ignore that subtraction and diviison aren't commutative; a = b - (c - d) gets decompiled as a = b - c - d, which is different.
compiling fails
Wow, you both got here quick. Does the new commit fix it?
Wow, you both got here quick. Does the new commit fix it?
Yep.