Versions in this module Expand all Collapse all v0 v0.4.0 Nov 24, 2026 Changes in this version + func CanonicalRangeExpr(text string) string + func ParseFloatString(s string) (float64, error) + func ParseIntString(s string) (int64, error) + func TrimNumericSpace(s string) string v0.3.0 Aug 19, 2026 Changes in this version + var ErrDeadlineExceeded = errors.New("expr: evaluation deadline exceeded") + var TAny = Type + var TBool = Type + var TFloat = Type + var TInt = Type + var TNoReturn = Type + var TNull = Type + var TPath = Type + var TRangeExpr = Type + var TString = Type + func EvalForBalanceCheck(src string, target Type) (live, resultSize int64, err error) + func LineCol(src string, offset int) (line, col int) + func SizeOf(v Value) int64 + type Access struct + Attr string + Offset int + X Node + func (n *Access) Pos() int + type Binary struct + L Node + Offset int + Op Op + R Node + func (n *Binary) Pos() int + type BoolLit struct + Offset int + Val bool + func (n *BoolLit) Pos() int + type Call struct + Args []Node + Callee Node + Offset int + func (n *Call) Pos() int + type Code int + const CodeAny + const CodeBool + const CodeFloat + const CodeInt + const CodeList + const CodeNoReturn + const CodeNull + const CodePath + const CodeRangeExpr + const CodeString + const CodeUnion + const CodeUnresolved + const CodeVarT + const CodeVarT1 + const CodeVarT2 + const CodeVarT3 + func (c Code) String() string + type Compare struct + Offset int + OpOffsets []int + Operands []Node + Ops []Op + func (n *Compare) Pos() int + type Cond struct + Else Node + If Node + Offset int + Then Node + func (n *Cond) Pos() int + type Cost struct + ArgBytes []int + ArgElements []int + ResultBytes bool + ResultElements bool + type Error struct + Msg string + Offset int + Src string + func (e *Error) Error() string + func (e *Error) Unwrap() error + type Expression struct + func Parse(src string) (*Expression, error) + func (e *Expression) CalledFunctions() []string + func (e *Expression) CallsAny(names map[string]struct{}) bool + func (e *Expression) Eval(syms Symbols, target Type, opts ...Option) (Value, error) + func (e *Expression) Names() []string + func (e *Expression) Root() Node + func (e *Expression) Source() string + type FloatLit struct + Offset int + Val float64 + func (n *FloatLit) Pos() int + type Index struct + Idx Node + Offset int + X Node + func (n *Index) Pos() int + type IntLit struct + Offset int + Val int64 + func (n *IntLit) Pos() int + type ListComp struct + Cond Node + Elem Node + Iter Node + Offset int + Var string + VarOffset int + func (n *ListComp) Pos() int + type ListLit struct + Elems []Node + Offset int + func (n *ListLit) Pos() int + type Logical struct + L Node + Offset int + Op Op + R Node + func (n *Logical) Pos() int + type MapSymbols map[string]Value + func (m MapSymbols) Lookup(name string) (Value, bool) + type Name struct + Offset int + Parts []string + func (n *Name) Pos() int + func (n *Name) String() string + type Node interface + Pos func() int + type NullLit struct + Offset int + func (n *NullLit) Pos() int + type Op int + const OpAdd + const OpAnd + const OpDiv + const OpEq + const OpFloorDiv + const OpGe + const OpGt + const OpIn + const OpLe + const OpLt + const OpMod + const OpMul + const OpNe + const OpNeg + const OpNot + const OpNotIn + const OpOr + const OpPos + const OpPow + const OpSub + func (o Op) String() string + type Option func(*evalCtx) + func WithClock(now func() time.Time) Option + func WithDeadline(t time.Time) Option + func WithMemoryLimit(bytes int64) Option + func WithOperationLimit(ops int64) Option + func WithPathFormat(f PathFormat) Option + func WithPathMapping(rules []PathMapRule) Option + type PathFormat int + const PathNative + const PathPOSIX + const PathWindows + type PathMapRule struct + DestinationPath string + SourceFormat PathMapSourceFormat + SourcePath string + type PathMapSourceFormat int + const PathMapPOSIX + const PathMapURI + const PathMapWindows + type Shape struct + Cost Cost + Fn func(args []Value) (Value, error) + FnCtx func(ec evalCtx, args []Value) (Value, error) + Params []Type + Promote promotion + Ret Type + RetOf func(b bindings) Type + type Slice struct + Offset int + Start Node + Step Node + Stop Node + X Node + func (n *Slice) Pos() int + type StringLit struct + Offset int + Val string + func (n *StringLit) Pos() int + type Symbols interface + Lookup func(name string) (Value, bool) + type Type struct + Code Code + Params []Type + func JobParamTypes(declared string) (paramType, rawType Type) + func ListOf(elem Type) Type + func OptionalOf(t Type) Type + func ParseType(s string) (Type, error) + func TaskParamType(declared string) Type + func UnionOf(ts ...Type) Type + func UnresolvedOf(t Type) Type + func (t Type) Equal(o Type) bool + func (t Type) String() string + type Unary struct + Offset int + Op Op + X Node + func (n *Unary) Pos() int + type Value struct + Type Type + func Bool(b bool) Value + func Coerce(v Value, target Type) (Value, error) + func Eval(src string, syms Symbols, target Type, opts ...Option) (Value, error) + func EvalWithMetrics(src string, syms Symbols, target Type, opts ...Option) (Value, int64, error) + func Float(f float64) Value + func FloatText(f float64, text string) Value + func Int(i int64) Value + func List(elem Type, vals []Value) Value + func Null() Value + func Path(text string, f PathFormat) Value + func RangeExpr(text string) (Value, error) + func String(s string) Value + func Unresolved(constraint Type) Value + func ValueFromText(t Type, raw string, pathFlavor PathFormat) Value + func (v Value) AsBool() bool + func (v Value) AsFloat() float64 + func (v Value) AsInt() int64 + func (v Value) AsList() []Value + func (v Value) AsRangeExpr() string + func (v Value) AsStr() string + func (v Value) Equal(o Value) bool + func (v Value) IsNull() bool + func (v Value) IsUnresolved() bool + func (v Value) String() string