aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs39
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs8
2 files changed, 25 insertions, 22 deletions
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs
index d5271a1..06c7387 100644
--- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs
+++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs
@@ -72,9 +72,9 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
72 private string FilePrefix; 72 private string FilePrefix;
73 private string ScriptEnginesPath = "ScriptEngines"; 73 private string ScriptEnginesPath = "ScriptEngines";
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 Dictionary<KeyValuePair<int, int>, KeyValuePair<int, int>> m_positionMap; // mapping between LSL and C# line/column numbers
78 private static CSharpCodeProvider CScodeProvider = new CSharpCodeProvider(); 78 private static CSharpCodeProvider CScodeProvider = new CSharpCodeProvider();
79 private static VBCodeProvider VBcodeProvider = new VBCodeProvider(); 79 private static VBCodeProvider VBcodeProvider = new VBCodeProvider();
80 private static JScriptCodeProvider JScodeProvider = new JScriptCodeProvider(); 80 private static JScriptCodeProvider JScodeProvider = new JScriptCodeProvider();
@@ -277,8 +277,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
277 { 277 {
278 // Its LSL, convert it to C# 278 // Its LSL, convert it to C#
279 compileScript = LSL_Converter.Convert(Script); 279 compileScript = LSL_Converter.Convert(Script);
280 //compileScript = LSL_Converter.Convert(Script); 280 m_positionMap = LSL_Converter.PositionMap;
281 //m_positionMap = LSL_Converter.PositionMap;
282 l = enumCompileType.cs; 281 l = enumCompileType.cs;
283 } 282 }
284 283
@@ -483,24 +482,24 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
483 string errtext = String.Empty; 482 string errtext = String.Empty;
484 foreach (CompilerError CompErr in results.Errors) 483 foreach (CompilerError CompErr in results.Errors)
485 { 484 {
486 //KeyValuePair<int, int> lslPos; 485 KeyValuePair<int, int> lslPos;
487 486
488 //try 487 try
489 //{ 488 {
490 // lslPos = m_positionMap[new KeyValuePair<int, int>(CompErr.Line, CompErr.Column)]; 489 lslPos = m_positionMap[new KeyValuePair<int, int>(CompErr.Line, CompErr.Column)];
491 //} 490 }
492 //catch (KeyNotFoundException) // we don't have this line/column mapped 491 catch (KeyNotFoundException) // we don't have this line/column mapped
493 //{ 492 {
494 // m_scriptEngine.Log.Debug(String.Format("[{0}]: Lookup of C# line {1}, column {2} failed.", m_scriptEngine.ScriptEngineName, CompErr.Line, CompErr.Column)); 493 m_scriptEngine.Log.Debug(String.Format("[{0}]: Lookup of C# line {1}, column {2} failed.", m_scriptEngine.ScriptEngineName, CompErr.Line, CompErr.Column));
495 // lslPos = new KeyValuePair<int, int>(-CompErr.Line, -CompErr.Column); 494 lslPos = new KeyValuePair<int, int>(-CompErr.Line, -CompErr.Column);
496 //} 495 }
497 496
498 // The Second Life viewer's script editor begins 497 // The Second Life viewer's script editor begins
499 // countingn lines and columns at 0, so we subtract 1. 498 // countingn lines and columns at 0, so we subtract 1.
500 //errtext += String.Format("Line {0}, column {1}, Error Number: {2}, '{3}'\r\n", lslPos.Key - 1, lslPos.Value - 1, CompErr.ErrorNumber, CompErr.ErrorText); 499 errtext += String.Format("Line {0}, column {1}, Error Number: {2}, '{3}'\r\n", lslPos.Key - 1, lslPos.Value - 1, CompErr.ErrorNumber, CompErr.ErrorText);
501 errtext += "Line number " + (CompErr.Line - LinesToRemoveOnError) + 500 //errtext += "Line number " + (CompErr.Line - LinesToRemoveOnError) +
502 ", Error Number: " + CompErr.ErrorNumber + 501 // ", Error Number: " + CompErr.ErrorNumber +
503 ", '" + CompErr.ErrorText + "'\r\n"; 502 // ", '" + CompErr.ErrorText + "'\r\n";
504 } 503 }
505 Console.WriteLine("[COMPILER ERROR]:" + errtext); 504 Console.WriteLine("[COMPILER ERROR]:" + errtext);
506 if (!File.Exists(OutFile)) 505 if (!File.Exists(OutFile))
diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs
index cbf7980..2386c6f 100644
--- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs
@@ -82,7 +82,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
82 82
83 // private static int instanceID = new Random().Next(0, int.MaxValue); // Unique number to use on our compiled files 83 // private static int instanceID = new Random().Next(0, int.MaxValue); // Unique number to use on our compiled files
84 private static UInt64 scriptCompileCounter = 0; // And a counter 84 private static UInt64 scriptCompileCounter = 0; // And a counter
85 private bool m_UseCompiler = false; 85 private bool m_UseCompiler = true;
86 86
87 public IScriptEngine m_scriptEngine; 87 public IScriptEngine m_scriptEngine;
88 public Compiler(IScriptEngine scriptEngine) 88 public Compiler(IScriptEngine scriptEngine)
@@ -93,9 +93,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
93 public bool in_startup = true; 93 public bool in_startup = true;
94 public void ReadConfig() 94 public void ReadConfig()
95 { 95 {
96 // Turning on the compiler by default so hardcoding this option to
97 // true. Once it's clear we won't be going back to the old
98 // "compiler" this code will be removed completely.
99 // Mike, 2008.07.28
100 //m_UseCompiler = m_scriptEngine.Config.GetBoolean("UseNewCompiler", true);
96 101
97 // Get some config 102 // Get some config
98 m_UseCompiler = m_scriptEngine.Config.GetBoolean("UseNewCompiler", true);
99 WriteScriptSourceToDebugFile = m_scriptEngine.Config.GetBoolean("WriteScriptSourceToDebugFile", true); 103 WriteScriptSourceToDebugFile = m_scriptEngine.Config.GetBoolean("WriteScriptSourceToDebugFile", true);
100 CompileWithDebugInformation = m_scriptEngine.Config.GetBoolean("CompileWithDebugInformation", true); 104 CompileWithDebugInformation = m_scriptEngine.Config.GetBoolean("CompileWithDebugInformation", true);
101 105