LSL-PyOptimizer/lslopt
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
..
__init__.py Initial commit. Status so far: 2014-07-26 02:43:44 +02:00
lslbasefuncs.py Fix compare and llListSort for LSO. 2017-10-21 12:32:41 +02:00
lslcommon.py Get rid of StSw craziness and use lsllastpass to make another pass. 2017-11-02 18:20:14 +01:00
lsldeadcode.py Remove "magic names" where possible, using new data from fndata.txt 2017-10-27 23:39:26 +02:00
lslextrafuncs.py Remove "magic names" where possible, using new data from fndata.txt 2017-10-27 23:39:26 +02:00
lslfoldconst.py Fix bug with nested if's; fix missing EXPR wrap. 2017-11-13 04:04:13 +01:00
lslfuncopt.py Comment fix. 2017-10-20 10:18:44 +02:00
lslfuncs.py Bump copyright year. 2017-08-09 19:45:46 +02:00
lsljson.py Change strategy for the checking of function input types. 2017-10-12 17:16:16 +02:00
lsllastpass.py Collect used library functions as reusable names for the renamer. 2017-11-02 23:19:33 +01:00
lslloadlib.py Implement flags aimed at removing "magic names" in the code. 2017-10-27 18:49:58 +02:00
lsloptimizer.py Collect used library functions as reusable names for the renamer. 2017-11-02 23:19:33 +01:00
lsloutput.py Fix bug with nested if's; fix missing EXPR wrap. 2017-11-13 04:04:13 +01:00
lslparse.py Fix EParseCantChangeState so that it is always properly reported. 2017-11-02 13:45:01 +01:00
lslrenamer.py Collect used library functions as reusable names for the renamer. 2017-11-02 23:19:33 +01:00