diff options
author | Charles Krinke | 2007-12-15 16:26:32 +0000 |
---|---|---|
committer | Charles Krinke | 2007-12-15 16:26:32 +0000 |
commit | fd360406b9be5ac8d32586e0142cde449ee53ee7 (patch) | |
tree | 5e1593c2a046dd07d5c528ff3230729b2ad3cace /OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs | |
parent | * some work on not storing the circuitPack (bad thing if we're going to reuse... (diff) | |
download | opensim-SC-fd360406b9be5ac8d32586e0142cde449ee53ee7.zip opensim-SC-fd360406b9be5ac8d32586e0142cde449ee53ee7.tar.gz opensim-SC-fd360406b9be5ac8d32586e0142cde449ee53ee7.tar.bz2 opensim-SC-fd360406b9be5ac8d32586e0142cde449ee53ee7.tar.xz |
Thanks again to Alondria for adding: math support for
rot * rot, vec / rot, == and != overriders for Rotations and Vectors.
Also: llRotBetween(), llGetRegionTimeDilation(). And fixing:
Error in LSL2CSConverter that botched a variable with a type name in it (ex: rotationCenter)
Fixed: Error in LSL2CSConverter that parsed which() loops incorrectly.
Fixed: Changed definition of Quaternion to <x, y, z, r> from <x, y, z, t> (As per LSL)
Finished: llEuler2Rot()
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs index d9ebd14..00ddbba 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs | |||
@@ -47,7 +47,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL | |||
47 | dataTypes.Add("key", "string"); | 47 | dataTypes.Add("key", "string"); |
48 | dataTypes.Add("vector", "LSL_Types.Vector3"); | 48 | dataTypes.Add("vector", "LSL_Types.Vector3"); |
49 | dataTypes.Add("rotation", "LSL_Types.Quaternion"); | 49 | dataTypes.Add("rotation", "LSL_Types.Quaternion"); |
50 | dataTypes.Add("list", "List"); | 50 | dataTypes.Add("list", "List<string>"); |
51 | dataTypes.Add("null", "null"); | 51 | dataTypes.Add("null", "null"); |
52 | } | 52 | } |
53 | 53 | ||
@@ -203,7 +203,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL | |||
203 | //Console.WriteLine("Replacing using statename: " + current_statename); | 203 | //Console.WriteLine("Replacing using statename: " + current_statename); |
204 | cache = | 204 | cache = |
205 | Regex.Replace(cache, | 205 | Regex.Replace(cache, |
206 | @"^(\s*)((?!(if|switch|for)[^a-zA-Z0-9_])[a-zA-Z0-9_]*\s*\([^\)]*\)[^;]*\{)", | 206 | @"^(\s*)((?!(if|switch|for|while)[^a-zA-Z0-9_])[a-zA-Z0-9_]*\s*\([^\)]*\)[^;]*\{)", |
207 | @"$1public " + current_statename + "_event_$2", | 207 | @"$1public " + current_statename + "_event_$2", |
208 | RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline); | 208 | RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline); |
209 | } | 209 | } |
@@ -236,7 +236,10 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL | |||
236 | RegexOptions.Compiled | RegexOptions.Multiline); | 236 | RegexOptions.Compiled | RegexOptions.Multiline); |
237 | // Replace return types and function variables - integer a() and f(integer a, integer a) | 237 | // Replace return types and function variables - integer a() and f(integer a, integer a) |
238 | Script = | 238 | Script = |
239 | Regex.Replace(Script, @"(^|;|}|[\(,])(\s*)" + key + @"(\s*)", @"$1$2" + val + "$3", | 239 | Regex.Replace(Script, @"(^|;|}|[\(,])(\s*)" + key + @"(\s+)", @"$1$2" + val + "$3", |
240 | RegexOptions.Compiled | RegexOptions.Multiline); | ||
241 | Script = | ||
242 | Regex.Replace(Script, @"(^|;|}|[\(,])(\s*)" + key + @"(\s*)[,]", @"$1$2" + val + "$3,", | ||
240 | RegexOptions.Compiled | RegexOptions.Multiline); | 243 | RegexOptions.Compiled | RegexOptions.Multiline); |
241 | } | 244 | } |
242 | 245 | ||
@@ -281,7 +284,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL | |||
281 | // Add namespace, class name and inheritance | 284 | // Add namespace, class name and inheritance |
282 | 285 | ||
283 | Return = "" + | 286 | Return = "" + |
284 | "using OpenSim.Region.ScriptEngine.Common;"; | 287 | "using OpenSim.Region.ScriptEngine.Common; using System.Collections.Generic;"; |
285 | //"using System; " + | 288 | //"using System; " + |
286 | //"using System.Collections.Generic; " + | 289 | //"using System.Collections.Generic; " + |
287 | //"using System.Text; " + | 290 | //"using System.Text; " + |