diff options
author | Melanie Thielker | 2008-09-23 13:28:17 +0000 |
---|---|---|
committer | Melanie Thielker | 2008-09-23 13:28:17 +0000 |
commit | d95794d05c8e98877189c9c6b306110a9fc2df59 (patch) | |
tree | e35c78dd6241b947d7249d3a4699ef9859ca8839 /OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs | |
parent | Add file missed in last commit (which never completed) (diff) | |
download | opensim-SC-d95794d05c8e98877189c9c6b306110a9fc2df59.zip opensim-SC-d95794d05c8e98877189c9c6b306110a9fc2df59.tar.gz opensim-SC-d95794d05c8e98877189c9c6b306110a9fc2df59.tar.bz2 opensim-SC-d95794d05c8e98877189c9c6b306110a9fc2df59.tar.xz |
Refactor XEngine parser as per suggestions from mikem
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs index febc5e1..5a98f4d 100644 --- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs +++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs | |||
@@ -726,19 +726,20 @@ 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; | ||
731 | if (0 < dotIndex && (dotIndex == c.Value.Length || !Char.IsDigit(c.Value[dotIndex]))) | 729 | if (0 < dotIndex && (dotIndex == c.Value.Length || !Char.IsDigit(c.Value[dotIndex]))) |
732 | c.Value = c.Value.Insert(dotIndex, "0"); | 730 | c.Value = c.Value.Insert(dotIndex, "0"); |
731 | c.Value = "new LSL_Types.LSLFloat("+c.Value+")"; | ||
732 | } | ||
733 | else if("LSL_Types.LSLInteger" == c.Type) | ||
734 | { | ||
735 | c.Value = "new LSL_Types.LSLInteger("+c.Value+")"; | ||
736 | } | ||
737 | else if("LSL_Types.LSLString" == c.Type) | ||
738 | { | ||
739 | c.Value = "new LSL_Types.LSLString(\""+c.Value+"\")"; | ||
733 | } | 740 | } |
734 | 741 | ||
735 | // commented because the parser does it now | ||
736 | // need to quote strings | ||
737 | // if ("LSL_Types.LSLString" == c.Type) | ||
738 | // retstr += Generate("\""); | ||
739 | retstr += Generate(c.Value, c); | 742 | retstr += Generate(c.Value, c); |
740 | // if ("LSL_Types.LSLString" == c.Type) | ||
741 | // retstr += Generate("\""); | ||
742 | 743 | ||
743 | return retstr; | 744 | return retstr; |
744 | } | 745 | } |