This is an attempt to fix the handling of constants in LSL.

It wraps constants in new LSLType(x), so that lists with
constant values are processed correctly. Contains changes to
the lsl.parser.cs that are not (yet) reflected in opensim-libs,
since this experimental patch affects XEngine only. Also contains
nuts.
This commit is contained in:
Melanie Thielker
2008-09-01 23:33:12 +00:00
parent bfeb3881f2
commit a5d2674a43
3 changed files with 34 additions and 31 deletions

View File

@@ -726,16 +726,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
if ("LSL_Types.LSLFloat" == c.Type)
{
int dotIndex = c.Value.IndexOf('.') + 1;
// Skip first dot (in type name)
dotIndex = c.Value.IndexOf('.', dotIndex) + 1;
if (0 < dotIndex && (dotIndex == c.Value.Length || !Char.IsDigit(c.Value[dotIndex])))
c.Value = c.Value.Insert(dotIndex, "0");
}
// commencted because the parser does it now
// need to quote strings
if ("LSL_Types.LSLString" == c.Type)
retstr += Generate("\"");
// if ("LSL_Types.LSLString" == c.Type)
// retstr += Generate("\"");
retstr += Generate(c.Value, c);
if ("LSL_Types.LSLString" == c.Type)
retstr += Generate("\"");
// if ("LSL_Types.LSLString" == c.Type)
// retstr += Generate("\"");
return retstr;
}