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

20 lines
445 B
C#
Raw Permalink Normal View History

2023-07-30 07:55:10 +00:00
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);
}
}
}