aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs
diff options
context:
space:
mode:
authorMike Mazur2008-07-23 06:53:38 +0000
committerMike Mazur2008-07-23 06:53:38 +0000
commitf9e2f41d7c7906db6e09d3ee4ed6f508df847344 (patch)
treeeb6972df3227206c23d58b65c164eba4f34f821b /OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs
parentThanks, sempuki, for a patch that adds .addin.xml for MSSQL and SQLite users. (diff)
downloadopensim-SC-f9e2f41d7c7906db6e09d3ee4ed6f508df847344.zip
opensim-SC-f9e2f41d7c7906db6e09d3ee4ed6f508df847344.tar.gz
opensim-SC-f9e2f41d7c7906db6e09d3ee4ed6f508df847344.tar.bz2
opensim-SC-f9e2f41d7c7906db6e09d3ee4ed6f508df847344.tar.xz
Enable LSL <-> C# source location mapping when reporing compiler errors to the user in-world. This method is not yet perfect but is an improvement in accuracy over the existing method.
Diffstat (limited to 'OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs')
-rw-r--r--OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs16
1 files changed, 16 insertions, 0 deletions
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs
index 73894d5..e2e8d36 100644
--- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs
+++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs
@@ -74,6 +74,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
74 74
75 private static LSL2CSConverter LSL_Converter = new LSL2CSConverter(); 75 private static LSL2CSConverter LSL_Converter = new LSL2CSConverter();
76 //private static CSCodeGenerator LSL_Converter = new CSCodeGenerator(); 76 //private static CSCodeGenerator LSL_Converter = new CSCodeGenerator();
77 //private static Dictionary<KeyValuePair<int, int>, KeyValuePair<int, int>> m_positionMap; // mapping between LSL and C# line/column numbers
77 private static CSharpCodeProvider CScodeProvider = new CSharpCodeProvider(); 78 private static CSharpCodeProvider CScodeProvider = new CSharpCodeProvider();
78 private static VBCodeProvider VBcodeProvider = new VBCodeProvider(); 79 private static VBCodeProvider VBcodeProvider = new VBCodeProvider();
79 private static JScriptCodeProvider JScodeProvider = new JScriptCodeProvider(); 80 private static JScriptCodeProvider JScodeProvider = new JScriptCodeProvider();
@@ -277,6 +278,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
277 // Its LSL, convert it to C# 278 // Its LSL, convert it to C#
278 compileScript = LSL_Converter.Convert(Script); 279 compileScript = LSL_Converter.Convert(Script);
279 //compileScript = LSL_Converter.Convert(Script); 280 //compileScript = LSL_Converter.Convert(Script);
281 //m_positionMap = LSL_Converter.PositionMap;
280 l = enumCompileType.cs; 282 l = enumCompileType.cs;
281 } 283 }
282 284
@@ -481,6 +483,20 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
481 string errtext = String.Empty; 483 string errtext = String.Empty;
482 foreach (CompilerError CompErr in results.Errors) 484 foreach (CompilerError CompErr in results.Errors)
483 { 485 {
486 //KeyValuePair<int, int> lslPos;
487
488 //try
489 //{
490 // lslPos = m_positionMap[new KeyValuePair<int, int>(CompErr.Line, CompErr.Column)];
491 //}
492 //catch (KeyNotFoundException) // we don't have this line/column mapped
493 //{
494 // lslPos = new KeyValuePair<int, int>(-1, -1);
495 //}
496
497 // The Second Life viewer's script editor begins
498 // countingn lines and columns at 0, so we subtract 1.
499 //errtext += String.Format("Line {0}, column {1}, Error Number: {2}, '{3}'\r\n", lslPos.Key - 1, lslPos.Value - 1, CompErr.ErrorNumber, CompErr.ErrorText);
484 errtext += "Line number " + (CompErr.Line - LinesToRemoveOnError) + 500 errtext += "Line number " + (CompErr.Line - LinesToRemoveOnError) +
485 ", Error Number: " + CompErr.ErrorNumber + 501 ", Error Number: " + CompErr.ErrorNumber +
486 ", '" + CompErr.ErrorText + "'\r\n"; 502 ", '" + CompErr.ErrorText + "'\r\n";