aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs12
1 files changed, 8 insertions, 4 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs
index 124f1e6..09d816f 100644
--- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs
@@ -72,8 +72,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
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 ICodeConverter LSL_Converter;
76 //private static CSCodeGenerator LSL_Converter;
77 private static CSharpCodeProvider CScodeProvider = new CSharpCodeProvider(); 76 private static CSharpCodeProvider CScodeProvider = new CSharpCodeProvider();
78 private static VBCodeProvider VBcodeProvider = new VBCodeProvider(); 77 private static VBCodeProvider VBcodeProvider = new VBCodeProvider();
79 private static JScriptCodeProvider JScodeProvider = new JScriptCodeProvider(); 78 private static JScriptCodeProvider JScodeProvider = new JScriptCodeProvider();
@@ -82,6 +81,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
82 81
83 // private static int instanceID = new Random().Next(0, int.MaxValue); // Unique number to use on our compiled files 82 // 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 83 private static UInt64 scriptCompileCounter = 0; // And a counter
84 private bool m_UseCompiler = false;
85 85
86 public IScriptEngine m_scriptEngine; 86 public IScriptEngine m_scriptEngine;
87 public Compiler(IScriptEngine scriptEngine) 87 public Compiler(IScriptEngine scriptEngine)
@@ -94,6 +94,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
94 { 94 {
95 95
96 // Get some config 96 // Get some config
97 m_UseCompiler = m_scriptEngine.Config.GetBoolean("UseNewCompiler", true);
97 WriteScriptSourceToDebugFile = m_scriptEngine.Config.GetBoolean("WriteScriptSourceToDebugFile", true); 98 WriteScriptSourceToDebugFile = m_scriptEngine.Config.GetBoolean("WriteScriptSourceToDebugFile", true);
98 CompileWithDebugInformation = m_scriptEngine.Config.GetBoolean("CompileWithDebugInformation", true); 99 CompileWithDebugInformation = m_scriptEngine.Config.GetBoolean("CompileWithDebugInformation", true);
99 100
@@ -324,9 +325,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
324 if (l == enumCompileType.lsl) 325 if (l == enumCompileType.lsl)
325 { 326 {
326 // Its LSL, convert it to C# 327 // Its LSL, convert it to C#
328 //compileScript = LSL_Converter.Convert(Script);
329 if(m_UseCompiler)
330 LSL_Converter = (ICodeConverter)new CSCodeGenerator();
331 else
332 LSL_Converter = (ICodeConverter)new LSL2CSConverter();
327 compileScript = LSL_Converter.Convert(Script); 333 compileScript = LSL_Converter.Convert(Script);
328 //LSL_Converter = new CSCodeGenerator(Script);
329 //compileScript = LSL_Converter.Generate();
330 l = enumCompileType.cs; 334 l = enumCompileType.cs;
331 } 335 }
332 336