mirror of
https://github.com/MontFerret/ferret.git
synced 2025-03-05 15:16:07 +02:00
22 lines
413 B
Go
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
|
||
|
}
|