27 lines
786 B
C#
27 lines
786 B
C#
using System.Collections.Immutable;
|
|
using Upsilon.Binder;
|
|
using Upsilon.Evaluator;
|
|
|
|
namespace Upsilon.BaseTypes
|
|
{
|
|
internal class LuaFunction : LuaType, IScopeOwner
|
|
{
|
|
public LuaFunction(ImmutableArray<VariableSymbol> parameters, BoundBlockStatement block,
|
|
EvaluationScope parentScope)
|
|
{
|
|
Parameters = parameters;
|
|
Block = block;
|
|
EvaluationScope = new EvaluationScope(parentScope);
|
|
}
|
|
|
|
public override Type Type => Type.Function;
|
|
public override object ToCSharpObject()
|
|
{
|
|
return this;
|
|
}
|
|
|
|
public ImmutableArray<VariableSymbol> Parameters { get; }
|
|
public BoundBlockStatement Block { get; }
|
|
public EvaluationScope EvaluationScope { get; }
|
|
}
|
|
} |