mirror of
https://github.com/Sei-Lisa/LSL-PyOptimizer
synced 2025-07-01 15:48:21 +00:00
No description
The algorithm for adding parentheses around unary operators was not working properly. It converted a * (-b) * c into a * -b * c, which LSL handles as a * -(b * c). Fix and add test cases for that. One of the test cases shows an example where the difference matters: 0 * (-1e20) * 1e20 should result in 0.0, but if wrongly parenthesized, it gives NaN, because 1e20*1e20 gives infinity due to float overflow, and minus infinity times 0 is indeterminate. The addition of parentheses has been improved, but it still does not eliminate every redundant parenthesis. Also fix the horrendous typo of using "operands" where it should be "operators". |
||
---|---|---|
lslopt | ||
pcpp@ed3b3f02e8 | ||
unit_tests | ||
.gitignore | ||
.gitmodules | ||
builtins-unittest.txt | ||
builtins.txt | ||
COPYING | ||
cpreproc.py | ||
fndata.txt | ||
main.py | ||
README.md | ||
run-tests.py | ||
strutil.py |
LSL PyOptimizer
LSL PyOptimizer is a LSL2 script optimizer written in Python 2. Currently it only supports code memory optimization (no speed optimization), only for Mono (no LSO), and only for the Second Life flavour of LSL (no OpenSim etc.).
HTML introduction, list of features and documentation available at http://lsl.blacktulip-virtual.com/lsl-pyoptimizer/