2023-03-09 23:57:16 +00:00
|
|
|
namespace tlang
|
|
|
|
{
|
|
|
|
public class PostfixIncrementVariableNode : Node
|
|
|
|
{
|
|
|
|
public GetVariableValue Node {get;set;}
|
|
|
|
|
|
|
|
public PostfixIncrementVariableNode(GetVariableValue ret)
|
|
|
|
{
|
|
|
|
Node = ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
public override TObject Execute(IScopeEnvironment nodeEnv)
|
|
|
|
{
|
|
|
|
|
|
|
|
var obj=Node.Execute(nodeEnv);
|
|
|
|
|
2023-06-08 18:14:35 +00:00
|
|
|
var newVal=new AddNode(new ConstNode(obj),new ConstNode(TObject.Number(1))).Execute(nodeEnv);
|
2023-03-09 23:57:16 +00:00
|
|
|
|
|
|
|
|
|
|
|
Node.SetValue(nodeEnv,newVal);
|
|
|
|
|
|
|
|
|
|
|
|
return obj;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|