diff options
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs | 13 |
1 files changed, 9 insertions, 4 deletions
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 | |||
54 | vb = 2, | 54 | vb = 2, |
55 | js = 3 | 55 | js = 3 |
56 | } | 56 | } |
57 | |||
58 | /// <summary> | ||
59 | /// This contains number of lines WE use for header when compiling script. User will get error in line x-LinesToRemoveOnError when error occurs. | ||
60 | /// </summary> | ||
61 | public int LinesToRemoveOnError = 2; | ||
57 | private enumCompileType DefaultCompileLanguage; | 62 | private enumCompileType DefaultCompileLanguage; |
58 | private bool WriteScriptSourceToDebugFile; | 63 | private bool WriteScriptSourceToDebugFile; |
59 | private bool CompileWithDebugInformation; | 64 | private bool CompileWithDebugInformation; |
@@ -273,14 +278,14 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL | |||
273 | String.Empty + "public class Script : OpenSim.Region.ScriptEngine.Common.LSL_BaseClass { " + | 278 | String.Empty + "public class Script : OpenSim.Region.ScriptEngine.Common.LSL_BaseClass { " + |
274 | @"public Script() { } " + | 279 | @"public Script() { } " + |
275 | compileScript + | 280 | compileScript + |
276 | "} }\r\n"; | 281 | "} }\r\n\r\n"; |
277 | break; | 282 | break; |
278 | case enumCompileType.vb: | 283 | case enumCompileType.vb: |
279 | // "Public Sub New()\nEnd Sub: " + | ||
280 | compileScript = String.Empty + | 284 | compileScript = String.Empty + |
281 | "Imports OpenSim.Region.ScriptEngine.Common: Imports System.Collections.Generic: " + | 285 | "Imports OpenSim.Region.ScriptEngine.Common: Imports System.Collections.Generic: " + |
282 | String.Empty + "NameSpace SecondLife:" + | 286 | String.Empty + "NameSpace SecondLife:" + |
283 | String.Empty + "Public Class Script: Inherits OpenSim.Region.ScriptEngine.Common.LSL_BaseClass: " + | 287 | String.Empty + "Public Class Script: Inherits OpenSim.Region.ScriptEngine.Common.LSL_BaseClass: " + |
288 | "Public Sub New()\r\nEnd Sub: " + | ||
284 | compileScript + | 289 | compileScript + |
285 | ":End Class :End Namespace\r\n"; | 290 | ":End Class :End Namespace\r\n"; |
286 | break; | 291 | break; |
@@ -291,7 +296,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL | |||
291 | "class Script : OpenSim.Region.ScriptEngine.Common.LSL_BaseClass { " + | 296 | "class Script : OpenSim.Region.ScriptEngine.Common.LSL_BaseClass { " + |
292 | @"public Script() { } " + | 297 | @"public Script() { } " + |
293 | compileScript + | 298 | compileScript + |
294 | "} }\r\n"; | 299 | "} }\r\n\r\n"; |
295 | break; | 300 | break; |
296 | } | 301 | } |
297 | return CompileFromCSorVBText(compileScript, l); | 302 | return CompileFromCSorVBText(compileScript, l); |
@@ -393,7 +398,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL | |||
393 | string errtext = String.Empty; | 398 | string errtext = String.Empty; |
394 | foreach (CompilerError CompErr in results.Errors) | 399 | foreach (CompilerError CompErr in results.Errors) |
395 | { | 400 | { |
396 | errtext += "Line number " + (CompErr.Line - 1) + | 401 | errtext += "Line number " + (CompErr.Line - LinesToRemoveOnError) + |
397 | ", Error Number: " + CompErr.ErrorNumber + | 402 | ", Error Number: " + CompErr.ErrorNumber + |
398 | ", '" + CompErr.ErrorText + "'\r\n"; | 403 | ", '" + CompErr.ErrorText + "'\r\n"; |
399 | } | 404 | } |