tlang-runtime-compiler/TLang.VM/TExternalMethod.cs

20 lines
445 B
C#

using System;
namespace TLang.VM
{
internal class TExternalMethod : TCallable
{
public Func<TObject[], TObject> Callback {get;set;}
public TExternalMethod(Func<TObject[], TObject> value)
{
Callback = (args)=>{
return value(args);
};
}
public override TObject Execute(params TObject[] args)
{
return Callback(args);
}
}
}