Documentation ¶
Index ¶
- Variables
- func Equal(v1, v2 Value) bool
- func ExpectNArg(got, want int) error
- type Expr
- type Func
- type Getter
- type Kind
- type Pool
- type Value
- func Bool(ok bool) Value
- func DefaultOnVarMissing(varName string) (Value, error)
- func Eval(s string, getter map[string]Value, pool *Pool) (Value, error)
- func False() Value
- func Float(f float64) Value
- func Int(i int64) Value
- func NewValue(kind Kind) Value
- func Nil() Value
- func String(s string) Value
- func True() Value
- func Zero() Value
- func (v Value) Add(v2 Value) (Value, error)
- func (v Value) And(v2 Value) Value
- func (v Value) Bool() bool
- func (v Value) Contains(v2 Value) Value
- func (v Value) Eq(v2 Value) (Value, error)
- func (v Value) Float() float64
- func (v Value) Ge(v2 Value) (Value, error)
- func (v Value) Gt(v2 Value) (Value, error)
- func (v Value) Int() int64
- func (v Value) Kind() Kind
- func (v Value) Le(v2 Value) (Value, error)
- func (v Value) Lt(v2 Value) (Value, error)
- func (v Value) Mul(v2 Value) (Value, error)
- func (v Value) Ne(v2 Value) (Value, error)
- func (v Value) Not() Value
- func (v Value) Or(v2 Value) Value
- func (v Value) Pow(v2 Value) (Value, error)
- func (v Value) Quo(v2 Value) (Value, error)
- func (v Value) Rem(v2 Value) (Value, error)
- func (v *Value) Set(s string) error
- func (v Value) String() string
- func (v Value) Sub(v2 Value) (Value, error)
- type VarGetter
- type VarMissingFunc
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrFailedToParseInteger = errors.New("failed to parse integer") ErrFailedToParseFloat = errors.New("failed to parse float") ErrNotAnInteger = errors.New("not an integer") ErrNotAFloat = errors.New("not a float") ErrUnsupportedType = errors.New("unsupported type") ErrTypeMismatchForOp = errors.New("type mismatch for operater") ErrDivideZero = errors.New("divide zero") ErrPowOfZero = errors.New("power of zero") ErrComparedTypesMismatch = errors.New("compared types mismatch") ErrBadArgumentsSize = errors.New("bad arguments size") )
Functions ¶
func ExpectNArg ¶
Types ¶
type Expr ¶
type Expr struct {
// contains filtered or unexported fields
}
Expr is top-level object of expr package
type Pool ¶
type Pool struct {
// contains filtered or unexported fields
}
func MustNewPool ¶
func (*Pool) SetOnVarMissing ¶
func (p *Pool) SetOnVarMissing(fn VarMissingFunc)
type Value ¶
type Value struct {
// contains filtered or unexported fields
}
func DefaultOnVarMissing ¶
type VarMissingFunc ¶
Click to show internal directories.
Click to hide internal directories.