Move PythonType2LSL to the main lsloptimizer script.

This is preparation work for splitting the optimizer.
This commit is contained in:
Sei Lisa 2014-08-13 13:44:54 +02:00
parent f3301b07c6
commit 36759cacba
2 changed files with 6 additions and 6 deletions

View file

@ -1,5 +1,6 @@
import lslfuncs
from lslfuncs import Key, Vector, Quaternion
from lslparse import warning
from lslrenamer import renamer
@ -17,9 +18,14 @@ class optimizer(renamer, deadcode):
binary_ops = frozenset(('+','-','*','/','%','<<','>>','<','<=','>','>=',
'==','!=','|','^','&','||','&&'))
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 FoldAndRemoveEmptyStmts(self, lst):
"""Utility function for elimination of useless expressions in FOR"""
idx = 0