mirror of
https://github.com/opensim/opensim.git
synced 2026-08-02 06:44:15 +08:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user