aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs
diff options
context:
space:
mode:
authorMelanie Thielker2008-09-01 23:33:12 +0000
committerMelanie Thielker2008-09-01 23:33:12 +0000
commita5d2674a439df4f13285ab43bde194535bc31be1 (patch)
tree42351442f99ca46ac5f722346ed073ad2b9c0113 /OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs
parentAnother attempt at fixing XEngine llSetPrimitiveParams: Make it accept (diff)
downloadopensim-SC_OLD-a5d2674a439df4f13285ab43bde194535bc31be1.zip
opensim-SC_OLD-a5d2674a439df4f13285ab43bde194535bc31be1.tar.gz
opensim-SC_OLD-a5d2674a439df4f13285ab43bde194535bc31be1.tar.bz2
opensim-SC_OLD-a5d2674a439df4f13285ab43bde194535bc31be1.tar.xz
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.
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs11
1 files changed, 7 insertions, 4 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs
index 2226673..b357ab6 100644
--- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs
@@ -726,16 +726,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
726 if ("LSL_Types.LSLFloat" == c.Type) 726 if ("LSL_Types.LSLFloat" == c.Type)
727 { 727 {
728 int dotIndex = c.Value.IndexOf('.') + 1; 728 int dotIndex = c.Value.IndexOf('.') + 1;
729 // Skip first dot (in type name)
730 dotIndex = c.Value.IndexOf('.', dotIndex) + 1;
729 if (0 < dotIndex && (dotIndex == c.Value.Length || !Char.IsDigit(c.Value[dotIndex]))) 731 if (0 < dotIndex && (dotIndex == c.Value.Length || !Char.IsDigit(c.Value[dotIndex])))
730 c.Value = c.Value.Insert(dotIndex, "0"); 732 c.Value = c.Value.Insert(dotIndex, "0");
731 } 733 }
732 734
735 // commencted because the parser does it now
733 // need to quote strings 736 // need to quote strings
734 if ("LSL_Types.LSLString" == c.Type) 737 // if ("LSL_Types.LSLString" == c.Type)
735 retstr += Generate("\""); 738 // retstr += Generate("\"");
736 retstr += Generate(c.Value, c); 739 retstr += Generate(c.Value, c);
737 if ("LSL_Types.LSLString" == c.Type) 740 // if ("LSL_Types.LSLString" == c.Type)
738 retstr += Generate("\""); 741 // retstr += Generate("\"");
739 742
740 return retstr; 743 return retstr;
741 } 744 }