Documentation ¶
Index ¶
- Variables
- func CharPosOfErr(err error) int
- type Context
- type Extender
- type Op
- type Value
- func Bool(t bool) Value
- func Custom(v interface{}) Value
- func Eval(expr string, ctx *Context) (Value, error)
- func EvalForEach(expr string, iter func(value Value) error, ctx *Context) (Value, error)
- func Float64(x float64) Value
- func Int64(x int64) Value
- func Number(x float64) Value
- func String(s string) Value
- func Uint64(x uint64) Value
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Undefined = Value{/* contains filtered or unexported fields */} Null = Value{/* contains filtered or unexported fields */} )
View Source
var ErrStop = errors.New("stop")
View Source
var ErrUndefined = errors.New("undefined")
Functions ¶
func CharPosOfErr ¶
CharPosOfErr returns the character position of where the error occured in the Eval function, or -1 if unknown
Types ¶
type Extender ¶
type Op ¶
type Op int
Op is an operator for Custom values used for the Options.Op function.
const ( OpAdd Op // + OpSub // - OpMul // * OpDiv // / OpMod // % OpLt // < OpLte // <= OpGt // > OpGte // >= OpEq // == OpNeq // != OpAnd // && OpOr // || OpCoal // ?? )
type Value ¶
type Value struct {
// contains filtered or unexported fields
}
Value represents is the return value of Eval.
func EvalForEach ¶ added in v0.6.0
EvalForEach iterates over a series of comma delimited expressions. The last value in the series is returned. Returning ErrStop will stop the iteration early and return the last known value and nil as an error. Returning any other error from iter will stop the iteration and return the same error.
Click to show internal directories.
Click to hide internal directories.