Documentation ¶
Index ¶
- func NewContext(conf *config.Config) value.Context
- type Context
- func (c *Context) Assign(name string, val value.Value)
- func (c *Context) Config() *config.Config
- func (c *Context) Declare(name string)
- func (c *Context) Eval(exprs []value.Expr) []value.Value
- func (c *Context) EvalBinary(left value.Value, op string, right value.Value) value.Value
- func (c *Context) EvalUnary(op string, right value.Value) value.Value
- func (c *Context) ForgetAll()
- func (c *Context) Lookup(name string) value.Value
- func (c *Context) SetConstants()
- func (c *Context) UserDefined(op string, isBinary bool) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
Context holds execution context, specifically the binding of names to values and operators. It is the only implementation of ../value/Context, but since it references the value package, there would be a cycle if that package depended on this type definition.
func (*Context) Assign ¶
Assign assigns the variable the value. The variable must be defined either in the current function or globally. Inside a function, new variables become locals.
func (*Context) EvalBinary ¶
EvalBinary evaluates a binary operator.
func (*Context) SetConstants ¶
func (c *Context) SetConstants()
SetConstants re-assigns the fundamental constant values using the current setting of floating-point precision.
Click to show internal directories.
Click to hide internal directories.