No description
Find a file
Sei Lisa ec509b3840 Fix parenthesization of unary minus
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".
2019-05-04 23:20:20 +02:00
lslopt Fix parenthesization of unary minus 2019-05-04 23:20:20 +02:00
pcpp@ed3b3f02e8 Update to latest pcpp (fixes __LINE__) 2019-01-18 16:46:12 +01:00
unit_tests Fix parenthesization of unary minus 2019-05-04 23:20:20 +02:00
.gitignore Add the outfile.tmp file generated by a test to .gitignore 2019-01-15 23:22:02 +01:00
.gitmodules Don't report pcpp as modified if it has untracked files 2019-01-12 20:33:52 +01:00
builtins-unittest.txt Get rid of builtins.txt.dat by adding a parameter to the parser ctor. 2015-07-09 20:35:14 +02:00
builtins.txt New upstream version of builtins.txt 2019-02-23 02:06:03 +01:00
COPYING Add copyright notices to all files, to prepare the program for release. 2015-03-05 23:18:41 +01:00
cpreproc.py Fix non-compliance problem with octal/hex literals without U suffix 2019-01-21 16:28:15 +01:00
fndata.txt Add missing functions to fndata.txt 2019-02-08 18:30:33 +01:00
main.py The encoding of sys.stderr can exist and be None. 2019-05-01 01:22:54 +02:00
README.md Update link to point to lsl.blacktulip-virtual.com instead of lsl.project.zone 2018-01-18 15:41:28 +01:00
run-tests.py Allow returning void expressions where state changes are allowed 2019-05-01 04:28:58 +02:00
strutil.py Style fixes 2019-02-04 00:07:12 +01:00

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/