KumiScript/parser/ParenthesisToken.cs

25 lines
531 B
C#
Raw Normal View History

2024-01-26 05:37:51 +00:00
using KumiScript.Interpreter;
namespace KumiScript.Reader
{
public class ParenthesisToken : Token
{
public readonly bool _leftParen;
public ParenthesisToken(bool lp)
{
_leftParen = lp;
}
public override Expression Accept(ITokenVisitor tokenVisitor)
{
return tokenVisitor.VisitParen(this);
}
public override string GetValue()
{
if (_leftParen)
return "(";
return ")";
}
}
}