From ba846e62ef4d47f41992d6bba8b706d299f06eea Mon Sep 17 00:00:00 2001 From: Tedd Hansen Date: Thu, 7 Feb 2008 15:36:58 +0000 Subject: Same VB.Net patch done right. --- .../ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL') diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs index 2173178..6ea8187 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs @@ -54,6 +54,11 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL vb = 2, js = 3 } + + /// + /// This contains number of lines WE use for header when compiling script. User will get error in line x-LinesToRemoveOnError when error occurs. + /// + public int LinesToRemoveOnError = 2; private enumCompileType DefaultCompileLanguage; private bool WriteScriptSourceToDebugFile; private bool CompileWithDebugInformation; @@ -273,14 +278,14 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL String.Empty + "public class Script : OpenSim.Region.ScriptEngine.Common.LSL_BaseClass { " + @"public Script() { } " + compileScript + - "} }\r\n"; + "} }\r\n\r\n"; break; case enumCompileType.vb: - // "Public Sub New()\nEnd Sub: " + compileScript = String.Empty + "Imports OpenSim.Region.ScriptEngine.Common: Imports System.Collections.Generic: " + String.Empty + "NameSpace SecondLife:" + String.Empty + "Public Class Script: Inherits OpenSim.Region.ScriptEngine.Common.LSL_BaseClass: " + + "Public Sub New()\r\nEnd Sub: " + compileScript + ":End Class :End Namespace\r\n"; break; @@ -291,7 +296,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL "class Script : OpenSim.Region.ScriptEngine.Common.LSL_BaseClass { " + @"public Script() { } " + compileScript + - "} }\r\n"; + "} }\r\n\r\n"; break; } return CompileFromCSorVBText(compileScript, l); @@ -393,7 +398,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL string errtext = String.Empty; foreach (CompilerError CompErr in results.Errors) { - errtext += "Line number " + (CompErr.Line - 1) + + errtext += "Line number " + (CompErr.Line - LinesToRemoveOnError) + ", Error Number: " + CompErr.ErrorNumber + ", '" + CompErr.ErrorText + "'\r\n"; } -- cgit v1.1