KumiScript/interpreter/expression/TrueExpression.cs

33 lines
691 B
C#
Raw Normal View History

2024-01-26 05:37:51 +00:00
namespace KumiScript.Interpreter
{
public class TrueExpression : Expression
{
private static TrueExpression? _instance;
private TrueExpression()
{
}
public static TrueExpression GetInstance()
{
if (_instance is null)
_instance = new TrueExpression();
return _instance;
}
public override bool Equals(Expression expr)
{
return expr is TrueExpression;
}
public override Expression Eval(Environment env)
{
return this;
}
public override string ToString()
{
return "t";
}
}
}