20 lines
507 B
C#
20 lines
507 B
C#
using System.Collections.Generic;
|
|
|
|
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;
|
|
}
|
|
}
|
|
} |