2017-08-09 19:45:46 +02:00
|
|
|
# (C) Copyright 2015-2017 Sei Lisa. All rights reserved.
|
2015-03-05 23:18:41 +01:00
|
|
|
#
|
|
|
|
|
# This file is part of LSL PyOptimizer.
|
|
|
|
|
#
|
|
|
|
|
# LSL PyOptimizer is free software: you can redistribute it and/or
|
|
|
|
|
# modify it under the terms of the GNU General Public License as
|
|
|
|
|
# published by the Free Software Foundation, either version 3 of the
|
|
|
|
|
# License, or (at your option) any later version.
|
|
|
|
|
#
|
|
|
|
|
# LSL PyOptimizer is distributed in the hope that it will be useful,
|
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
|
#
|
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
|
# along with LSL PyOptimizer. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
2014-07-26 02:43:44 +02:00
|
|
|
# These types just wrap the Python types to make type() work on them.
|
|
|
|
|
# There are no ops defined on them or anything.
|
|
|
|
|
|
|
|
|
|
class Key(unicode):
|
|
|
|
|
def __repr__(self):
|
2014-07-27 17:40:26 +02:00
|
|
|
return 'Key(' + super(Key, self).__repr__() + ')'
|
2014-07-26 02:43:44 +02:00
|
|
|
|
|
|
|
|
class Vector(tuple):
|
|
|
|
|
def __repr__(self):
|
2014-07-27 17:40:26 +02:00
|
|
|
return 'Vector(' + super(Vector, self).__repr__() + ')'
|
2014-07-26 02:43:44 +02:00
|
|
|
|
|
|
|
|
class Quaternion(tuple):
|
|
|
|
|
def __repr__(self):
|
2014-07-27 17:40:26 +02:00
|
|
|
return 'Quaternion(' + super(Quaternion, self).__repr__() + ')'
|
2014-07-26 02:43:44 +02:00
|
|
|
|
|
|
|
|
# Recognized: 3763, 6466, 6495
|
2016-12-15 04:35:09 +01:00
|
|
|
# BUG-3763 affected llXorBase64 (see lslbasefuncs.py). It's been fixed.
|
|
|
|
|
# BUG-6466 is about some valid numbers in JSON not being accepted. It's fixed.
|
|
|
|
|
# BUG-6495 is about "]" inside a JSON string closing an array. It's NOT FIXED.
|
2014-07-26 02:43:44 +02:00
|
|
|
Bugs = set([6495])
|
|
|
|
|
|
2016-12-20 21:19:48 +01:00
|
|
|
# LSO is generally not supported, but some calculations can handle it. The
|
|
|
|
|
# main intention of this setting is for the code to serve as documentation
|
|
|
|
|
# of how LSO's behaviour differs from Mono's in the fine details.
|
2014-07-26 02:43:44 +02:00
|
|
|
LSO = False
|
2015-03-14 23:17:15 +01:00
|
|
|
|
2016-12-20 21:25:33 +01:00
|
|
|
# Set to True by lslcalc's main
|
|
|
|
|
IsCalc = False
|
|
|
|
|
|
2015-03-14 23:17:15 +01:00
|
|
|
DataPath = ''
|
2017-08-25 20:11:16 +02:00
|
|
|
|
|
|
|
|
# Conversion of LSL types to Python types and vice versa.
|
|
|
|
|
|
|
|
|
|
PythonType2LSL = {int: 'integer', float: 'float',
|
|
|
|
|
unicode: 'string', Key: 'key', Vector: 'vector',
|
|
|
|
|
Quaternion: 'rotation', list: 'list'}
|
|
|
|
|
|
|
|
|
|
LSLType2Python = {'integer':int, 'float':float,
|
|
|
|
|
'string':unicode, 'key':Key, 'vector':Vector,
|
|
|
|
|
'rotation':Quaternion, 'list':list}
|