No description
Find a file
Sei Lisa e42479756b Fix bug with nested if's; fix missing EXPR wrap.
097c054 introduced a bug that we hadn't caught until now.

In some occasions, it could swap nested conditions in such a way that the 'else' of the outer statement was made to belong to the inner one, like this:

    if (a)
        if (b)
            stuff;
    else
        stuff;

That is of course parsed with the 'else' belonging to if(b).

Fix implemented at output time, by detecting 'if(a) stmt; else y;' with stmt being an 'if' without 'else', and wrapping the stmt in {} like this: 'if(a){if(b) x;} else y;'. This has some similarity with parenthesis addition.

But the fix has the corner case that, since {} hides visibility of labels, when the inner 'if' has a label as direct child, it can't be swapped lest the label becomes out of scope. So these cases are detected and skipped in the constant folding module.

In the case of 'if(cond);', we transform it to 'cond;', but we forgot to wrap the cond in an EXPR node as required. Fixed too.
2017-11-13 04:04:13 +01:00
lslopt Fix bug with nested if's; fix missing EXPR wrap. 2017-11-13 04:04:13 +01:00
.gitignore Yet another follow-up to 2f4f403 (lslcalc support) 2016-12-15 04:15:26 +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. 2017-10-20 10:00:24 +02:00
COPYING Add copyright notices to all files, to prepare the program for release. 2015-03-05 23:18:41 +01:00
fndata.txt Implement flags aimed at removing "magic names" in the code. 2017-10-27 18:49:58 +02:00
main.py Remove "magic names" where possible, using new data from fndata.txt 2017-10-27 23:39:26 +02:00
README.md URL changed. 2016-12-15 04:37:45 +01:00
testfuncs.py Change strategy for the checking of function input types. 2017-10-12 17:16:16 +02:00
testparser.py Get rid of StSw craziness and use lsllastpass to make another pass. 2017-11-02 18:20:14 +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.project.zone/lsl-pyoptimizer/