mirror of
https://github.com/Sei-Lisa/LSL-PyOptimizer
synced 2025-07-01 15:48:21 +00:00
Unfold all assignment+operation operators to optimize them better.
With test case.
This commit is contained in:
parent
cb66f1ff4e
commit
a303ef2066
2 changed files with 35 additions and 18 deletions
|
@ -199,16 +199,17 @@ class Test02_Compiler(UnitTestCase):
|
|||
string s = "1" "2";
|
||||
list L = [(key)""];
|
||||
default{timer(){
|
||||
1+([]+(integer)~1);
|
||||
list a;
|
||||
float f;
|
||||
a = 3; a += 3;
|
||||
f += 4; f += -4.3;
|
||||
integer i;
|
||||
i |= i;
|
||||
"a" "b" "c";
|
||||
"a"+(key)"b"; (key)"a" + "b";
|
||||
i>>=i;
|
||||
1+([]+(integer)~1);
|
||||
list a;
|
||||
float f;
|
||||
a = 3; a += 3;
|
||||
f += 4; f += -4.3;
|
||||
integer i;
|
||||
i *= 1.3;
|
||||
i |= i;
|
||||
"a" "b" "c";
|
||||
"a"+(key)"b"; (key)"a" + "b";
|
||||
i>>=i;
|
||||
}}''',
|
||||
['explicitcast','extendedtypecast','extendedassignment',
|
||||
'extendedglobalexpr', 'allowmultistrings', 'allowkeyconcat',
|
||||
|
@ -264,6 +265,7 @@ class Test03_Optimizer(UnitTestCase):
|
|||
f += 4; f += -4.3;
|
||||
integer i;
|
||||
i = llGetListLength(L);
|
||||
i *= -3.0;
|
||||
print(3+2);
|
||||
for(i=3,i;1;){}
|
||||
i |= !i;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue