Parsing and testing boolean literals.

Signed-off-by: jmug <u.g.a.mariano@gmail.com>
This commit is contained in:
Mariano Uvalle 2025-01-04 19:16:22 -08:00
parent 5fa7b2481a
commit c417e90f36
3 changed files with 170 additions and 21 deletions

View file

@ -158,3 +158,16 @@ func (ie *InfixExpression) TokenLiteral() string {
func (ie *InfixExpression) String() string {
return "(" + ie.Left.String() + " " + ie.Operator + " " + ie.Right.String() + ")"
}
type Boolean struct {
Token token.Token
Value bool
}
func (bl *Boolean) expressionNode() {}
func (bl *Boolean) TokenLiteral() string {
return bl.Token.Literal
}
func (bl *Boolean) String() string {
return bl.Token.Literal
}