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

18 lines
358 B
Go

package literals
import (
"context"
"github.com/MontFerret/ferret/pkg/runtime/core"
"github.com/MontFerret/ferret/pkg/runtime/values"
)
type IntLiteral int
func NewIntLiteral(value int) IntLiteral {
return IntLiteral(value)
}
func (l IntLiteral) Exec(ctx context.Context, scope *core.Scope) (core.Value, error) {
return values.NewInt(int(l)), nil
}