mirror of
https://github.com/Sei-Lisa/LSL-PyOptimizer
synced 2025-07-01 23:58:20 +00:00
No description
Our previous fix was incomplete, because it failed to detect the last IF in a chain of ELSE IFs. For example: if (a == 2) llDie(); else if (a) llDie(); else if (a == 3) llDie(); That would be transformed by the IF swapper into: if (a ^ 2) if (a) llDie(); else if (a == 3) llDie(); else llDie(); Note that the last 'else' would bind to the last 'if', not to the first one. So the condition is actually like this: child[1] of an 'if' statement needs to be guarded in {} if the 'else' may belong to the wrong 'if'. It will belong to the wrong 'if' if child[1] is a (possibly empty) chain of 'if {whatever} else ...', followed by an 'if' without 'else', that is: if (cond) stmt; (which was what our previous check did), but also e.g.: if (cond) stmt; else if (cond) stmt; else if (cond) stmt; which we neglected to consider in our previous fix. |
||
---|---|---|
lslopt | ||
.gitignore | ||
builtins-unittest.txt | ||
builtins.txt | ||
COPYING | ||
fndata.txt | ||
main.py | ||
README.md | ||
testfuncs.py | ||
testparser.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.project.zone/lsl-pyoptimizer/