mirror of
https://github.com/opensim/opensim.git
synced 2026-08-01 14:16:07 +08:00
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.
This commit is contained in:
@@ -28,12 +28,16 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using log4net;
|
||||
using Tools;
|
||||
|
||||
namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
|
||||
{
|
||||
public class CSCodeGenerator : ICodeConverter
|
||||
{
|
||||
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
private SYMBOL m_astRoot = null;
|
||||
private Dictionary<KeyValuePair<int, int>, KeyValuePair<int, int>> m_positionMap;
|
||||
private int m_indentWidth = 4; // for indentation
|
||||
@@ -87,6 +91,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
|
||||
/// <returns>String containing the generated C# code.</returns>
|
||||
public string Convert(string script)
|
||||
{
|
||||
// m_log.DebugFormat("[CS CODE GENERATOR]: Converting to C#\n{0}", script);
|
||||
|
||||
m_warnings.Clear();
|
||||
ResetCounters();
|
||||
Parser p = new LSLSyntax(new yyLSLSyntax(), new ErrorHandler(true));
|
||||
|
||||
Reference in New Issue
Block a user