github.com/MontFerret/ferret@v0.18.0/pkg/runtime/expressions/literals/int.go (about)

     1  package literals
     2  
     3  import (
     4  	"context"
     5  
     6  	"github.com/MontFerret/ferret/pkg/runtime/core"
     7  	"github.com/MontFerret/ferret/pkg/runtime/values"
     8  )
     9  
    10  type IntLiteral int
    11  
    12  func NewIntLiteral(value int) IntLiteral {
    13  	return IntLiteral(value)
    14  }
    15  
    16  func (l IntLiteral) Exec(_ context.Context, _ *core.Scope) (core.Value, error) {
    17  	return values.NewInt(int(l)), nil
    18  }