Commit graph

14 commits

Author SHA1 Message Date
Sei Lisa
82081b2206 Fix crash when variables appear inside global lists.
Fixes #3.
2017-10-16 02:22:52 +02:00
Sei Lisa
cc96850f66 Fix bug where list elements of global declarations were removed.
CleanNode was too greedy, because children of global declarations (particularly lists) are not marked executable. Make a special case for them and don't recurse, since what matters is whether the declaration itself is executed. Its contents can't be cleaned up.
2017-10-16 02:22:40 +02:00
Sei Lisa
fe574bb462 Bump copyright year.
'bout time.
2017-08-09 19:45:46 +02:00
Sei Lisa
7419ac4982 Don't run dead code removal when in calc mode. Add TODO item.
Running 'main.py -O expr' without disabling DCR led to an immediate crash, due to it trying to access the default state.
2017-01-28 06:36:49 +01:00
Sei Lisa
cdc3a63179 Fix problem due to not copying a node. It still needs more analysis, but this patch is an improvement in that it fixes known problematic cases and doesn't seem to introduce new ones. 2015-06-14 05:11:32 +02:00
Sei Lisa
e1d0753fec When a state is removed, remove its global declaration too. 2015-06-13 02:19:15 +02:00
Sei Lisa
f7556e7a66 Remove globals from symbol table when no longer necessary. 2015-03-13 20:11:57 +01:00
Sei Lisa
fc7abc7d99 Fix bug broken by 562154e7aa.
Referencing a global that was optimized out, caused a crash.

```
integer DEBUG = 1;

default
{
    state_entry()
    {
        if (DEBUG) llOwnerSay("DEBUG");
    }
}
```
2015-03-13 16:49:31 +01:00
Sei Lisa
562154e7aa Remove the symbol table entry too when removing a global state/function/var. 2015-03-07 14:33:11 +01:00
Sei Lisa
c68a1f4ad6 Add copyright notices to all files, to prepare the program for release. 2015-03-05 23:18:41 +01:00
Sei Lisa
1dea1bd12c Make parentheses no longer explicit in the AST (Beta).
The output module adds parentheses where necessary, depending on the evaluation order in the tree. Or that's the idea. Prone to bugs, let's see how it bodes.
2015-02-28 00:43:26 +01:00
Sei Lisa
4461f36dce Emergency fix for a bug discovered via a nPose plugin. 2015-02-12 07:46:02 +01:00
Sei Lisa
36759cacba Move PythonType2LSL to the main lsloptimizer script.
This is preparation work for splitting the optimizer.
2014-08-13 13:44:54 +02:00
Sei Lisa
72b4b08cbe Add dead code elimination module. 2014-08-10 02:07:00 +02:00