tlang-interperter-cs/EnvironmentNode.cs

23 lines
589 B
C#
Raw Normal View History

2023-03-09 19:40:14 +00:00
namespace tlang
{
internal class EnvironmentNode : Node
{
public List<Node> Nodes {get;set;}=new List<Node>();
public override TObject Execute(IScopeEnvironment nodeEnv)
{
TObject returnType = TObject.Null;
foreach(var node in Nodes)
{
if(node is EnvironmentNode)
{
returnType =node.Execute(nodeEnv.SubEnv);
}else{
returnType = node.Execute(nodeEnv);
}
}
return returnType;
}
}
}