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:
Sei Lisa 2017-08-25 20:11:16 +02:00
parent 36947b7b12
commit 6738615360
5 changed files with 359 additions and 329 deletions

View file

@ -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.