diff options
author | Tedd Hansen | 2007-08-12 19:04:07 +0000 |
---|---|---|
committer | Tedd Hansen | 2007-08-12 19:04:07 +0000 |
commit | ed1208d04378b2ef9928ed270c99f4f99f3a30d5 (patch) | |
tree | b801ad73f59f7c055fde2f3b75022735b1a8051d /OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs | |
parent | ScriptManager now uses LSL-compiler. (diff) | |
download | opensim-SC-ed1208d04378b2ef9928ed270c99f4f99f3a30d5.zip opensim-SC-ed1208d04378b2ef9928ed270c99f4f99f3a30d5.tar.gz opensim-SC-ed1208d04378b2ef9928ed270c99f4f99f3a30d5.tar.bz2 opensim-SC-ed1208d04378b2ef9928ed270c99f4f99f3a30d5.tar.xz |
ScriptEngine successfully compiles script, we are now even further than LSO was.
Also added C# script support.
Diffstat (limited to 'OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs')
-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(); |