From 3b844cb7563a4f2eea85e1903b753858b4e6a531 Mon Sep 17 00:00:00 2001 From: Tedd Hansen Date: Sun, 10 Feb 2008 21:37:19 +0000 Subject: Untested bugfix in state support Replaced (?(?![a-zA-Z_]+)\s*)" + @"([a-zA-Z_]+)(?[^a-zA-Z_\(\)]*){ with (?(?![a-zA-Z_]+)\s*)" + @"(state\s+)?([a-zA-Z_]+)(?[^a-zA-Z_\(\)]*){ Lets see what happens now... :) --- .../ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/DotNetEngine') diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs index 613aa32..89921cd 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs @@ -176,7 +176,9 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL { // 0 => 1: Get last Match m = - Regex.Match(cache, @"(?![a-zA-Z_]+)\s*([a-zA-Z_]+)[^a-zA-Z_\(\)]*{", + //Regex.Match(cache, @"(?![a-zA-Z_]+)\s*([a-zA-Z_]+)[^a-zA-Z_\(\)]*{", + Regex.Match(cache, @"(?![a-zA-Z_]+)\s*(state\s+)?(?[a-zA-Z_]+)[^a-zA-Z_\(\)]*{", + RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline); in_state = false; @@ -184,11 +186,12 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL { // Go back to level 0, this is not a state in_state = true; - current_statename = m.Groups[1].Captures[0].Value; + current_statename = m.Groups["statename"].Captures[0].Value; //Console.WriteLine("Current statename: " + current_statename); cache = + //@"(?(?![a-zA-Z_]+)\s*)" + @"([a-zA-Z_]+)(?[^a-zA-Z_\(\)]*){", Regex.Replace(cache, - @"(?(?![a-zA-Z_]+)\s*)" + @"([a-zA-Z_]+)(?[^a-zA-Z_\(\)]*){", + @"(?(?![a-zA-Z_]+)\s*)" + @"(state\s+)?([a-zA-Z_]+)(?[^a-zA-Z_\(\)]*){", "${s1}${s2}", RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline); } @@ -260,7 +263,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL Regex.Replace(Script, @"<([^,>;]*,[^,>;\)]*,[^,>;\)]*,[^,>;\)]*)>", @"new LSL_Types.Quaternion($1)", RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline); Script = - Regex.Replace(Script, @"<([^,>;]*,[^,>;\)]*,[^,>;\)]*)>", @"new LSL_Types.Vector3($1)", + Regex.Replace(Script, @"<([^,>;)]*,[^,>;\)]*,[^,>;\)]*)>", @"new LSL_Types.Vector3($1)", RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline); // Replace List []'s -- cgit v1.1