1
0
mirror of https://github.com/MontFerret/ferret.git synced 2025-03-21 21:47:43 +02:00

22 lines
399 B
Go
Raw Normal View History

2018-09-18 16:42:38 -04:00
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)
}
2018-10-05 17:20:48 -04:00
func (l BooleanLiteral) Exec(_ context.Context, _ *core.Scope) (core.Value, error) {
if l {
2018-09-18 16:42:38 -04:00
return values.True, nil
}
return values.False, nil
}