tlang-interperter-cs/ScopeNode.cs

18 lines
472 B
C#

namespace tlang
{
public class ScopeNode : Node
{
public bool First {get;set;}
public List<Node> Body {get;set;}= new List<Node>();
public override TObject Execute(IScopeEnvironment nodeEnv)
{
var sub = First ? nodeEnv : nodeEnv.SubEnv;
TObject obj=new TNull();
foreach(var item in Body)
{
obj=item.Execute(sub);
}
return obj;
}
}
}