diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs index 906b2d3..2c514fc 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs | |||
@@ -20,8 +20,25 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL | |||
20 | // Output assembly name | 20 | // Output assembly name |
21 | string OutFile = Path.GetFileNameWithoutExtension(LSOFileName) + ".dll"; | 21 | string OutFile = Path.GetFileNameWithoutExtension(LSOFileName) + ".dll"; |
22 | 22 | ||
23 | Common.SendToDebug("Reading source code into memory"); | ||
23 | // TODO: Add error handling | 24 | // TODO: Add error handling |
24 | string CS_Code = LSL_Converter.Convert(File.ReadAllText(LSOFileName)); | 25 | string CS_Code; |
26 | switch (System.IO.Path.GetExtension(LSOFileName).ToLower()) | ||
27 | { | ||
28 | case ".txt": | ||
29 | case ".lsl": | ||
30 | Common.SendToDebug("Source code is LSL, converting to CS"); | ||
31 | CS_Code = LSL_Converter.Convert(File.ReadAllText(LSOFileName)); | ||
32 | break; | ||
33 | case ".cs": | ||
34 | Common.SendToDebug("Source code is CS"); | ||
35 | CS_Code = File.ReadAllText(LSOFileName); | ||
36 | break; | ||
37 | default: | ||
38 | throw new Exception("Unknown script type."); | ||
39 | } | ||
40 | |||
41 | Common.SendToDebug("Compiling"); | ||
25 | 42 | ||
26 | // Do actual compile | 43 | // Do actual compile |
27 | System.CodeDom.Compiler.CompilerParameters parameters = new CompilerParameters(); | 44 | System.CodeDom.Compiler.CompilerParameters parameters = new CompilerParameters(); |