diff options
author | Justin Clark-Casey (justincc) | 2012-02-07 17:44:37 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-02-07 17:44:37 +0000 |
commit | 038d1bf742ba4f95ca8a83b27f6fefb755485524 (patch) | |
tree | ec03beab5a4c0a3afd75b685d629f9d82d4199b9 /OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs | |
parent | Revert my two quick fixes for the lag issue and put in the real fix, which (diff) | |
download | opensim-SC-038d1bf742ba4f95ca8a83b27f6fefb755485524.zip opensim-SC-038d1bf742ba4f95ca8a83b27f6fefb755485524.tar.gz opensim-SC-038d1bf742ba4f95ca8a83b27f6fefb755485524.tar.bz2 opensim-SC-038d1bf742ba4f95ca8a83b27f6fefb755485524.tar.xz |
Add a regression test to compile and start a script. Remove Path.GetDirectoryName when getting assembly loading path in Compiler.CompileFromDotNetText().
The Path.GetDirectoryName call in Compiler.CompileFromDotNetText is unnecessary since AppDomain.CurrentDomain.BaseDirectory is always a directory.
Later path concatenation is already done by Path.Combine() which handles any trailing slash.
Removing Path.GetDirectoryName() will not affect the runtime but allows NUnit to work since it doesn't add a trailing slash to AppDomain.CurrentDomain.BaseDirectory.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs index b1fb6c2..8b88588 100644 --- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs +++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs | |||
@@ -28,12 +28,16 @@ | |||
28 | using System; | 28 | using System; |
29 | using System.IO; | 29 | using System.IO; |
30 | using System.Collections.Generic; | 30 | using System.Collections.Generic; |
31 | using System.Reflection; | ||
32 | using log4net; | ||
31 | using Tools; | 33 | using Tools; |
32 | 34 | ||
33 | namespace OpenSim.Region.ScriptEngine.Shared.CodeTools | 35 | namespace OpenSim.Region.ScriptEngine.Shared.CodeTools |
34 | { | 36 | { |
35 | public class CSCodeGenerator : ICodeConverter | 37 | public class CSCodeGenerator : ICodeConverter |
36 | { | 38 | { |
39 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | ||
40 | |||
37 | private SYMBOL m_astRoot = null; | 41 | private SYMBOL m_astRoot = null; |
38 | private Dictionary<KeyValuePair<int, int>, KeyValuePair<int, int>> m_positionMap; | 42 | private Dictionary<KeyValuePair<int, int>, KeyValuePair<int, int>> m_positionMap; |
39 | private int m_indentWidth = 4; // for indentation | 43 | private int m_indentWidth = 4; // for indentation |
@@ -87,6 +91,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools | |||
87 | /// <returns>String containing the generated C# code.</returns> | 91 | /// <returns>String containing the generated C# code.</returns> |
88 | public string Convert(string script) | 92 | public string Convert(string script) |
89 | { | 93 | { |
94 | // m_log.DebugFormat("[CS CODE GENERATOR]: Converting to C#\n{0}", script); | ||
95 | |||
90 | m_warnings.Clear(); | 96 | m_warnings.Clear(); |
91 | ResetCounters(); | 97 | ResetCounters(); |
92 | Parser p = new LSLSyntax(new yyLSLSyntax(), new ErrorHandler(true)); | 98 | Parser p = new LSLSyntax(new yyLSLSyntax(), new ErrorHandler(true)); |