From 50dcd33bab23c92854c34a5e18f1ba92273b2bd2 Mon Sep 17 00:00:00 2001 From: Tedd Hansen Date: Tue, 22 Jan 2008 09:00:49 +0000 Subject: Giving Mantis #388 a shot --- .../Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/DotNetEngine/Compiler') diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs index f3302ee..b35d562 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs @@ -73,7 +73,8 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL // QUOTE REPLACEMENT // temporarily replace quotes so we can work our magic on the script without - // always considering if we are inside our outside String.Empty's + // always considering if we are inside our outside quotes's + // TODO: Does this work on half-quotes in strings? ;) string _Script = System.String.Empty; string C; bool in_quote = false; @@ -251,7 +252,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL // Add "void" in front of functions that needs it Script = Regex.Replace(Script, - @"^(\s*public\s+)((?!(if|switch|for)[^a-zA-Z0-9_])[a-zA-Z0-9_]*\s*\([^\)]*\)[^;]*\{)", + @"^(\s*public\s+)?((?!(if|switch|for)[^a-zA-Z0-9_])[a-zA-Z0-9_]*\s*\([^\)]*\)[^;]*\{)", @"$1void $2", RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline); // Replace and -- cgit v1.1