diff options
Diffstat (limited to 'OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs')
-rw-r--r-- | OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs index 2c9031c..bbb9f06 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs | |||
@@ -152,7 +152,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL | |||
152 | in_state = true; | 152 | in_state = true; |
153 | current_statename = m.Groups[1].Captures[0].Value; | 153 | current_statename = m.Groups[1].Captures[0].Value; |
154 | //Console.WriteLine("Current statename: " + current_statename); | 154 | //Console.WriteLine("Current statename: " + current_statename); |
155 | cache = Regex.Replace(cache, @"(?![a-zA-Z_]+)\s*([a-zA-Z_]+)[^a-zA-Z_\(\)]*{", "", RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline); | 155 | cache = Regex.Replace(cache, @"(?<s1>(?![a-zA-Z_]+)\s*)" + @"([a-zA-Z_]+)(?<s2>[^a-zA-Z_\(\)]*){", "${s1}${s2}", RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline); |
156 | } | 156 | } |
157 | ret += cache; | 157 | ret += cache; |
158 | cache = ""; | 158 | cache = ""; |
@@ -169,7 +169,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL | |||
169 | // void dataserver(key query_id, string data) { | 169 | // void dataserver(key query_id, string data) { |
170 | //cache = Regex.Replace(cache, @"([^a-zA-Z_]\s*)((?!if|switch|for)[a-zA-Z_]+\s*\([^\)]*\)[^{]*{)", "$1" + "<STATE>" + "$2", RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline); | 170 | //cache = Regex.Replace(cache, @"([^a-zA-Z_]\s*)((?!if|switch|for)[a-zA-Z_]+\s*\([^\)]*\)[^{]*{)", "$1" + "<STATE>" + "$2", RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline); |
171 | //Console.WriteLine("Replacing using statename: " + current_statename); | 171 | //Console.WriteLine("Replacing using statename: " + current_statename); |
172 | cache = Regex.Replace(cache, @"^(\s*)((?!(if|switch|for)[^a-zA-Z0-9_])[a-zA-Z0-9_]*\s*\([^\)]*\)[^;]*\{)", @"public $1" + current_statename + "_event_$2", RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline); | 172 | cache = Regex.Replace(cache, @"^(\s*)((?!(if|switch|for)[^a-zA-Z0-9_])[a-zA-Z0-9_]*\s*\([^\)]*\)[^;]*\{)", @"$1public " + current_statename + "_event_$2", RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline); |
173 | } | 173 | } |
174 | 174 | ||
175 | ret += cache; | 175 | ret += cache; |
@@ -202,7 +202,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL | |||
202 | } | 202 | } |
203 | 203 | ||
204 | // Add "void" in front of functions that needs it | 204 | // Add "void" in front of functions that needs it |
205 | Script = Regex.Replace(Script, @"^(\s*)((?!(if|switch|for)[^a-zA-Z0-9_])[a-zA-Z0-9_]*\s*\([^\)]*\)[^;]*\{)", @"$1void $2", RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline); | 205 | Script = Regex.Replace(Script, @"^(\s*public\s+)((?!(if|switch|for)[^a-zA-Z0-9_])[a-zA-Z0-9_]*\s*\([^\)]*\)[^;]*\{)", @"$1void $2", RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline); |
206 | 206 | ||
207 | // Replace <x,y,z> and <x,y,z,r> | 207 | // Replace <x,y,z> and <x,y,z,r> |
208 | Script = Regex.Replace(Script, @"<([^,>]*,[^,>]*,[^,>]*,[^,>]*)>", @"new LSL_Types.Quaternion($1)", RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline); | 208 | Script = Regex.Replace(Script, @"<([^,>]*,[^,>]*,[^,>]*,[^,>]*)>", @"new LSL_Types.Quaternion($1)", RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline); |
@@ -228,15 +228,15 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL | |||
228 | 228 | ||
229 | // Add namespace, class name and inheritance | 229 | // Add namespace, class name and inheritance |
230 | Return = "" + | 230 | Return = "" + |
231 | "using System;\r\n" + | 231 | "using System; " + |
232 | "using System.Collections.Generic;\r\n" + | 232 | "using System.Collections.Generic; " + |
233 | "using System.Text;\r\n" + | 233 | "using System.Text; " + |
234 | "using OpenSim.Region.ScriptEngine.Common;\r\n" + | 234 | "using OpenSim.Region.ScriptEngine.Common; " + |
235 | "namespace SecondLife {\r\n"; | 235 | "namespace SecondLife { "; |
236 | Return += "" + | 236 | Return += "" + |
237 | //"[Serializable] " + | 237 | //"[Serializable] " + |
238 | "public class Script : OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL.LSL_BaseClass {\r\n"; | 238 | "public class Script : OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL.LSL_BaseClass { "; |
239 | Return += @"public Script() { }"+"\r\n"; | 239 | Return += @"public Script() { } "; |
240 | Return += Script; | 240 | Return += Script; |
241 | Return += "} }\r\n"; | 241 | Return += "} }\r\n"; |
242 | 242 | ||