progress
This commit is contained in:
parent
16e76d6b31
commit
484dbfc9d9
529 changed files with 113694 additions and 0 deletions
59
AspClassic.VBScript/hosting/VBScriptCode.cs
Normal file
59
AspClassic.VBScript/hosting/VBScriptCode.cs
Normal file
|
@ -0,0 +1,59 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.IO;
|
||||
using AspClassic.Scripting.Runtime;
|
||||
|
||||
using System.Dynamic;
|
||||
#if USE35
|
||||
// Needed for type language implementers need to support DLR Hosting, such as
|
||||
// ScriptCode.
|
||||
using AspClassic.Scripting.Ast;
|
||||
using AspClassic.Scripting.Utils;
|
||||
#else
|
||||
using System.Linq.Expressions;
|
||||
#endif
|
||||
using AspClassic.Scripting;
|
||||
using Dlrsoft.VBScript.Runtime;
|
||||
|
||||
namespace Dlrsoft.VBScript.Hosting
|
||||
{
|
||||
class VBScriptCode : ScriptCode
|
||||
{
|
||||
//private readonly Expression<Action<VBScript, IDynamicMetaObjectProvider>> _lambda;
|
||||
private readonly VBScript _vbscript;
|
||||
private AspClassic.Scripting.Utils.Action<VBScript, IDynamicMetaObjectProvider> _compiledLambda;
|
||||
|
||||
public VBScriptCode(
|
||||
VBScript vbscript,
|
||||
AspClassic.Scripting.Utils.Action<VBScript, IDynamicMetaObjectProvider> lambda,
|
||||
SourceUnit sourceUnit)
|
||||
: base(sourceUnit) {
|
||||
_compiledLambda = lambda;
|
||||
_vbscript = vbscript;
|
||||
}
|
||||
|
||||
public override object Run() {
|
||||
return Run(new Scope());
|
||||
}
|
||||
|
||||
public override object Run(Scope scope) {
|
||||
//if (_compiledLambda == null) {
|
||||
// _compiledLambda = _lambda.Compile();
|
||||
//}
|
||||
//LC Load the system by default
|
||||
//RuntimeHelpers.VBScriptImport(_vbscript, module, new string[] { "System" }, new string[] { }, new string[] { });
|
||||
//RuntimeHelpers.VBScriptImport(_vbscript, module, new string[] { "VBScript", "Runtime" }, new string[] { "BuiltInFunctions" }, new string[] { "BuiltIn" });
|
||||
|
||||
//if (this.SourceUnit.Kind == SourceCodeKind.File)
|
||||
//{
|
||||
// // Simple way to convey script rundir for RuntimeHelpers.SymplImport
|
||||
// // to load .sympl files relative to the current script file.
|
||||
// DynamicObjectHelpers.SetMember(module, "__file__",
|
||||
// Path.GetFullPath(this.SourceUnit.Path));
|
||||
//}
|
||||
_compiledLambda(_vbscript, scope);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue