Parsing and testing boolean literals.
Signed-off-by: jmug <u.g.a.mariano@gmail.com>
This commit is contained in:
parent
5fa7b2481a
commit
c417e90f36
3 changed files with 170 additions and 21 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue