mirror of
https://github.com/Sei-Lisa/LSL-PyOptimizer
synced 2025-07-01 15:48:21 +00:00
Separate library function optimization into a different file.
No other functional changes. This required quite some reorganization affecting many files. As a side effect, PythonType2LSL and LSLType2Python aren't duplicate anymore.
This commit is contained in:
parent
36947b7b12
commit
6738615360
5 changed files with 359 additions and 329 deletions
|
@ -37,13 +37,6 @@ class optimizer(foldconst, renamer, deadcode):
|
|||
'==','!=','|','^','&','||','&&'))
|
||||
assign_ops = frozenset(('=','+=','-=','*=','/=','%=','&=','|=','^=','<<=','>>='))
|
||||
|
||||
LSL2PythonType = {'integer':int, 'float':float, 'string':unicode, 'key':lslfuncs.Key,
|
||||
'vector':lslfuncs.Vector, 'rotation':lslfuncs.Quaternion, 'list':list}
|
||||
|
||||
PythonType2LSL = {int: 'integer', float: 'float',
|
||||
unicode: 'string', Key: 'key', Vector: 'vector',
|
||||
Quaternion: 'rotation', list: 'list'}
|
||||
|
||||
def Cast(self, value, newtype):
|
||||
"""Return a CAST node if the types are not equal, otherwise the
|
||||
value unchanged.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue