33 lines
691 B
C#
33 lines
691 B
C#
|
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";
|
||
|
}
|
||
|
}
|
||
|
}
|