1
0
mirror of https://github.com/MontFerret/ferret.git synced 2024-12-16 11:37:36 +02:00
ferret/pkg/runtime/expressions/literals/boolean.go
2018-09-18 16:42:38 -04:00

22 lines
413 B
Go

package literals
import (
"context"
"github.com/MontFerret/ferret/pkg/runtime/core"
"github.com/MontFerret/ferret/pkg/runtime/values"
)
type BooleanLiteral bool
func NewBooleanLiteral(val bool) BooleanLiteral {
return BooleanLiteral(val)
}
func (l BooleanLiteral) Exec(ctx context.Context, scope *core.Scope) (core.Value, error) {
if l == true {
return values.True, nil
}
return values.False, nil
}