From a968d05864d205a289f05074338bb1e7165bc4e6 Mon Sep 17 00:00:00 2001 From: Tedd Hansen Date: Sun, 12 Aug 2007 18:06:02 +0000 Subject: LSL BuiltIn implementation is now in Compiler\LSL\LSL_BaseClass. So users won't have to reference every internal command by object. --- .../DotNetEngine/Compiler/LSL/LSL2CSConverter.cs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs') diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs index d9042b5..99fdb0d 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Text; using System.Text.RegularExpressions; -namespace LSL2CS.Converter +namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL { public class LSL2CSConverter { @@ -30,6 +30,7 @@ namespace LSL2CS.Converter public string Convert(string Script) { string Return = ""; + Script = " \r\n" + Script; // // Prepare script for processing @@ -143,7 +144,7 @@ namespace LSL2CS.Converter // Go back to level 0, this is not a state in_state = true; current_statename = m.Groups[1].Captures[0].Value; - Console.WriteLine("Current statename: " + current_statename); + //Console.WriteLine("Current statename: " + current_statename); cache = Regex.Replace(cache, @"(?![a-zA-Z_]+)\s*([a-zA-Z_]+)[^a-zA-Z_\(\)]*{", "", RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline); } ret += cache; @@ -160,7 +161,7 @@ namespace LSL2CS.Converter //Replace function names // void dataserver(key query_id, string data) { //cache = Regex.Replace(cache, @"([^a-zA-Z_]\s*)((?!if|switch|for)[a-zA-Z_]+\s*\([^\)]*\)[^{]*{)", "$1" + "" + "$2", RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline); - Console.WriteLine("Replacing using statename: " + current_statename); + //Console.WriteLine("Replacing using statename: " + current_statename); cache = Regex.Replace(cache, @"^(\s*)((?!if|switch|for)[a-zA-Z0-9_]*\s*\([^\)]*\)[^;]*\{)", @"$1" + current_statename + "_$2", RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline); } @@ -219,10 +220,10 @@ namespace LSL2CS.Converter // Add namespace, class name and inheritance - Return = "namespace SecondLife {" + Environment.NewLine; - Return += "public class Script : LSL_BaseClass {" + Environment.NewLine; + Return = "namespace SecondLife {\r\n"; + Return += "public class Script : OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL.LSL_BaseClass {\r\n"; Return += Script; - Return += "} }" + Environment.NewLine; + Return += "} }\r\n"; return Return; } -- cgit v1.1