diff --git a/OpenSim/Region/ScriptEngine/XEngine/LSL2CSConverter.cs b/OpenSim/Region/ScriptEngine/XEngine/LSL2CSConverter.cs index 9c5910816b..9e8ea54ff4 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/LSL2CSConverter.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/LSL2CSConverter.cs @@ -302,6 +302,17 @@ namespace OpenSim.Region.ScriptEngine.XEngine RegexOptions.Compiled | RegexOptions.Multiline); } + // Change jumps into goto's and prefix its label + Script = + Regex.Replace(Script, + @"(\W)jump\s+([a-zA-Z_][a-zA-Z_0-9]*)\s*;", + @"$1goto label_$2;", RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline); + // and prefix labels so the do not clash with C#'s reserved words + Script = + Regex.Replace(Script, + @"@([a-zA-Z_][a-zA-Z_0-9]*)\s*;", + @"label_$1: ;", RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline); + // Add "void" in front of functions that needs it Script = Regex.Replace(Script,