mirror of
https://github.com/MontFerret/ferret.git
synced 2025-01-06 03:03:57 +02:00
acf2f13dcb
* sync with MontFerret/ferret * fix --param handling When params is converted to map it uses strings.Split, which slices a string into all substrings separated by :. * remove impossible conditions nil != nil * delete ineffectual assignments * replace '+= 1' with '++' * remove useless comparison with nil * merge variable declarations * remove bool comparison * fix imports * fix imports * delete unused file * use copy instead of loop * delete unused DummyInterface * remove unnecassary break statements * tidy modules
22 lines
399 B
Go
22 lines
399 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(_ context.Context, _ *core.Scope) (core.Value, error) {
|
|
if l {
|
|
return values.True, nil
|
|
}
|
|
|
|
return values.False, nil
|
|
}
|