8b9676e5dc
Fix missing 'paramscope', remove commented out old body, simplify.
Sei Lisa
2015-03-04 01:51:08 +01:00
a6127cf144
lazylistcompat idea ditched.
Sei Lisa
2015-03-04 00:40:07 +01:00
87b6002b6c
Fix the bug detected in llListReplaceList.
Sei Lisa
2015-03-04 00:31:55 +01:00
8ea6ae50fd
Replace the lazy_list_set function with a more compact one.
Sei Lisa
2015-03-03 20:00:40 +01:00
30c492d2b3
Oops, fix a format string fail (the help wasn't shown).
Sei Lisa
2015-03-03 19:58:40 +01:00
b73805e0ce
Add "lazy lists" assignment support (mylist[index] = value).
Sei Lisa
2015-03-03 17:59:51 +01:00
7e521780d6
Two more optimizations TODO
Sei Lisa
2015-03-03 17:49:57 +01:00
e36fc83b39
Noted important bug in llListReplaceList
Sei Lisa
2015-03-03 17:26:50 +01:00
0b55f6e64d
Oops, the operator is !, not -
Sei Lisa
2015-03-03 02:20:31 +01:00
05d46e9ac3
Optimize comparisons of the form int>2147483647 or int<-2147483648 and expand (>=, <=, !=) to !(<, >, ==) respectively.
Sei Lisa
2015-03-03 02:16:00 +01:00
493aed6c39
Optimize (-a)*b or a*(-b) to -(a*b), revisiting the expression.
Sei Lisa
2015-03-03 01:46:53 +01:00
22a1a2e8ba
Document the change to the symtab structure.
Sei Lisa
2015-03-03 00:51:48 +01:00
01f2bba2f4
Make *-2 and *2 only work for local variables. Needed an adition to the parser.
Sei Lisa
2015-03-03 00:49:14 +01:00
d8f42a5071
Remove obsolete comment about parentheses (they are now implicit).
Sei Lisa
2015-03-03 00:47:15 +01:00
c650ad26f8
Comment changes only.
Sei Lisa
2015-03-02 23:28:14 +01:00
3b7e461d82
Convert [x] -> (list)x except in globals.
Sei Lisa
2015-02-28 22:48:11 +01:00
831296eddc
Minor shortening of name to fit in line
Sei Lisa
2015-02-28 21:46:19 +01:00
762bf1f27b
Add some FIXMEs and TODOs, remove comment that no longer makes sense.
Sei Lisa
2015-02-28 20:39:23 +01:00
0ca5a8f5b0
Fix typo that made function calls be wrapped in parentheses on output.
Sei Lisa
2015-02-28 20:37:59 +01:00
e30a4ea25d
Fix addstrings option (oops).
Sei Lisa
2015-02-28 20:37:18 +01:00
8f83e2f1ab
Add "addstrings" option (disabled by default) to select whether to automatically concatenate strings during constant folding.
Sei Lisa
2015-02-28 20:01:51 +01:00
6ea01c4242
Added optimizations for most operators, and 'cornermath' option.
Sei Lisa
2015-02-28 18:30:04 +01:00
1440f7811e
Fix bug where (float)"infi" did not produce Infinity.
Sei Lisa
2015-02-28 17:34:26 +01:00
42ac090f03
Big bunch of expressions optimized, boolean/bitwise, and some new ideas.
Sei Lisa
2015-02-28 05:14:52 +01:00
1dea1bd12c
Make parentheses no longer explicit in the AST (Beta).
Sei Lisa
2015-02-28 00:43:26 +01:00
59451b90e5
On second thought, parentheses are only needed for ~ because it binds tighter.
Sei Lisa
2015-02-27 20:12:17 +01:00
25cbb91b6e
Fix bug where n*3+1 was optimized as -~n*3 rather than as -~(n*3). Also merge -2 with -1 and +2 with +1.
Sei Lisa
2015-02-27 20:05:14 +01:00
2047a128fb
Add two TODO items about parameters to common functions.
Sei Lisa
2015-02-27 19:20:31 +01:00
536b1ed2f9
Fix comments that mentioned the wrong property.
Sei Lisa
2015-02-27 19:18:28 +01:00
07590ea850
Fix bug where (a * 5) + 4 was converted to a + 5 + 4.
Sei Lisa
2015-02-27 19:12:22 +01:00
4c08b7173a
minor clarification of comment
Sei Lisa
2015-02-27 04:46:23 +01:00
d2fb302684
Add more functions whose result is known for certain operands.
Sei Lisa
2015-02-12 07:49:32 +01:00
6fb947fbc9
(Limitedly) apply distributive law for string and integer addition.
Sei Lisa
2015-02-12 07:47:35 +01:00
4461f36dce
Emergency fix for a bug discovered via a nPose plugin.
Sei Lisa
2015-02-12 07:46:02 +01:00
0a0e5926d5
Fix bug where negative signs of global integers weren't being output.
Sei Lisa
2015-02-12 04:23:47 +01:00
b62fb9a808
Make isstring and iskey stricter, plus one cosmetic change
Sei Lisa
2015-02-11 18:17:01 +01:00
86ca90a65b
Remove obsolete comment
Sei Lisa
2015-02-11 17:12:35 +01:00
db862bb4a6
Multi-commit:
Sei Lisa
2015-02-11 05:43:13 +01:00
716be215f2
Fix double negation and constant nodes; add optimization of -~-~ chains. Fix a case of addition. Add a case of parentheses.
Sei Lisa
2014-12-13 14:16:28 +01:00
e89869a563
Add TODOs
Sei Lisa
2014-12-13 13:12:02 +01:00
c2a30fb9ee
Simplify const + nonconst + const and nonconst + const + const.
Sei Lisa
2014-08-19 19:45:47 +02:00
c2437b33e7
Optimize [] + nonlist as (list)nonlist.
Sei Lisa
2014-08-17 16:31:46 +02:00
2e87d6df8c
llModPow has a delay so exclude it from SEF table.
Sei Lisa
2014-08-17 16:03:20 +02:00
f3bd091a6d
Update Side-Effect Free table with latest additions.
Sei Lisa
2014-08-17 15:43:41 +02:00
8e5166bb2e
Move the constant folding code to lslfoldconst.py.
Sei Lisa
2014-08-13 14:19:58 +02:00
beea757a0a
Fork (add a copy of) lsloptimizer.py as lslfoldconst.py.
Sei Lisa
2014-08-13 14:02:05 +02:00
36759cacba
Move PythonType2LSL to the main lsloptimizer script.
Sei Lisa
2014-08-13 13:44:54 +02:00
f3301b07c6
Fix test case.
Sei Lisa
2014-08-13 13:35:19 +02:00
ed4b963356
Rename _ops to _toks to eliminate ambiguity and facilitate a future merge.
Sei Lisa
2014-08-13 13:34:09 +02:00
62904dc02c
BUG-6466 was resurrected; the previous RE is valid.
Sei Lisa
2014-08-13 13:31:10 +02:00
72b4b08cbe
Add dead code elimination module.
Sei Lisa
2014-08-10 02:07:00 +02:00
e3d8533caf
Use self.shrinknames instead of checking the options again.
Sei Lisa
2014-08-10 02:05:31 +02:00
9295cb104a
Cast() now adds parentheses where necessary.
Sei Lisa
2014-08-10 01:14:29 +02:00
0d81f132ab
Fix bug where the assigned type was not checked in declarations.
Sei Lisa
2014-08-10 00:44:57 +02:00
9cf18ade60
Improve output of floats by minimizing them further.
Sei Lisa
2014-08-09 23:20:40 +02:00
649de92ebd
Restart numbering at every parameter table. Saves many identifiers.
Sei Lisa
2014-08-09 23:19:00 +02:00
de4d6f8857
Propagate X flag in Cast(): if the expression executes, so does the cast.
Sei Lisa
2014-08-08 04:05:01 +02:00
c080f4b596
Fix detection of SEF in assignments with vector/rot fields as LHS.
Sei Lisa
2014-08-08 04:03:37 +02:00
7a4a6d221e
Fix field assignment. Add regression test.
Sei Lisa
2014-08-08 00:52:23 +02:00
bf238f79b6
Add Side-Effect-Free table of functions.
Sei Lisa
2014-08-08 00:42:52 +02:00
5d7829dc9d
Fix a bunch of SEF-related bugs and forgotten cases.
Sei Lisa
2014-08-08 00:41:07 +02:00
7a6e13b786
Remove line that does nothing useful.
Sei Lisa
2014-08-07 22:10:15 +02:00
954b8d81d4
Forgot a SEF case.
Sei Lisa
2014-08-07 22:09:00 +02:00
a03e0261ff
Add TODO
Sei Lisa
2014-08-06 22:49:57 +02:00
9c4d81db08
Implement side-effect-free (SEF) analysis. Also optimize x++ to ++x.
Sei Lisa
2014-08-06 04:30:26 +02:00
0a7d409a4e
Report errors at EOL as errors at next line.
Sei Lisa
2014-08-06 04:12:44 +02:00
8d1e819771
Cosmetic changes: docstring style; remove commented code.
Sei Lisa
2014-08-06 04:11:57 +02:00
5773449edb
Convert warnings to add the WARNING: title in the function.
Sei Lisa
2014-08-05 15:55:49 +02:00
58e22f77ce
Prepare for the incoming Dead Code Removal module.
Sei Lisa
2014-08-05 15:47:14 +02:00
bcc7fe3524
Fix bug in FoldStmt where EXPR nodes were not optimized out.
Sei Lisa
2014-08-05 15:38:19 +02:00
24a32c30e3
Fix bug where folding a FOR loop with const false cond produced bad code.
Sei Lisa
2014-08-04 02:19:36 +02:00
17e94a0d0f
Add FoldCond as a stub. Change cond constant to -1. Add support for EXPR.
Sei Lisa
2014-08-03 20:06:50 +02:00
67f3061e19
Fix state switch error reporting bug. Add 'Not all code paths...' error.
Sei Lisa
2014-08-03 04:50:18 +02:00
14e5b78d94
Remove empty statements. Optimize out 'else ;' and 'else {}'.
Sei Lisa
2014-08-02 10:40:59 +02:00
dce6419b4f
Deal with the state change in globals error.
Sei Lisa
2014-08-01 23:51:24 +02:00
400809671e
Fix GetNextShortest. Add test and regression cases. Rename AssignNewNames.
Sei Lisa
2014-08-01 18:02:55 +02:00
50d1bb2c41
Bug fix: Error on existing events in current state.
Sei Lisa
2014-08-01 17:57:55 +02:00
dd446217a9
Fix bug with user function calls not being renamed.
Sei Lisa
2014-08-01 05:34:09 +02:00
6a9278cd28
Typo
Sei Lisa
2014-08-01 05:33:34 +02:00
6c248c46e3
Implement the shrinknames option.
Sei Lisa
2014-08-01 05:07:50 +02:00
847d7b1e20
Oops, forgot these in the editor without saving.
Sei Lisa
2014-08-01 02:02:24 +02:00
fb65144e1b
One less to-do.
Sei Lisa
2014-08-01 01:46:54 +02:00
d65f0f1f75
Fully implement duplabels, and prepare output for general renaming.
Sei Lisa
2014-08-01 01:41:21 +02:00
b5c440e4bc
Change __self__.__classname__ to the actual class name in exceptions.
Sei Lisa
2014-08-01 00:37:44 +02:00
e29f16d3eb
Add duplabels option (not yet implemented).
Sei Lisa
2014-08-01 00:33:20 +02:00
523857ed23
Slight wording change in a comment.
Sei Lisa
2014-07-31 23:21:50 +02:00
cf880b8dbf
Fix priorities for x << const optimization.
Sei Lisa
2014-07-31 19:45:30 +02:00
f03466629f
Fix several bugs in lslbasefuncs; change InternalJsonScanMatching strategy.
Sei Lisa
2014-07-31 19:18:26 +02:00
e620c9f305
Additional notes on choices. We're changing it next to the latest one.
Sei Lisa
2014-07-31 18:58:19 +02:00
be9145e3c3
Fix bug in float shrinking code.
Sei Lisa
2014-07-31 18:47:40 +02:00
a303ef2066
Unfold all assignment+operation operators to optimize them better.
Sei Lisa
2014-07-31 18:44:50 +02:00
cb66f1ff4e
Make if ... else if ... chains iterative, rather than recursive.
Sei Lisa
2014-07-31 05:41:15 +02:00
5bedc17b73
Fix bug where optimization disabled didn't return a value.
Sei Lisa
2014-07-31 05:39:20 +02:00
e5714eba25
Fix the obnoxious issue with globals propagation in full expressions.
Sei Lisa
2014-07-31 04:47:19 +02:00
5b401ff9a5
Copy the node, don't just ref it. Also add comments on the simple_expr issue.
Sei Lisa
2014-07-31 04:07:03 +02:00
66417276ae
Test cases for the previous commit
Sei Lisa
2014-07-31 03:31:42 +02:00
2cbed52bf7
Add optimization of declarations.
Sei Lisa
2014-07-31 03:29:21 +02:00
6ec39aa745
Add a bunch of optimizations. Fix || and && results.
Sei Lisa
2014-07-31 02:45:28 +02:00
0a567b0a39
Clean up the help a bit, removing unimplemented options.
Sei Lisa
2014-07-31 02:02:53 +02:00
3ac4bc4f0d
New option to optimize float-to-int conversion separately from sign optim.
Sei Lisa
2014-07-31 01:37:18 +02:00