Documentation
¶
Overview ¶
Package compeval runs GX code at compile time.
Index ¶
- func EvalExpr(ctx evaluator.Context, expr ir.Expr) (cpevelements.Element, error)
- func EvalInt(fetcher ir.Fetcher, expr ir.Expr) (int, error)
- func EvalRank(fetcher ir.Fetcher, expr ir.Expr) (ir.ArrayRank, []canonical.Canonical, error)
- func NewOptionVariable(vr *ir.VarExpr) options.PackageOption
- type CompEval
- func (ev *CompEval) ArrayOps() evaluator.ArrayOps
- func (ev *CompEval) ElementFromAtom(ctx ir.Evaluator, src ir.AssignableExpr, val values.Array) (evaluator.NumericalElement, error)
- func (ev *CompEval) Importer() ir.Importer
- func (ev *CompEval) NewFunc(itp *interp.Interpreter, fn ir.PkgFunc, recv *interp.Receiver) interp.Func
- func (ev *CompEval) NewFuncLit(fitp *interp.FileScope, fn *ir.FuncLit) (interp.Func, error)
- func (ev *CompEval) Processor() *processor.Processor
- func (ev *CompEval) Trace(ctx ir.Evaluator, call *ir.CallExpr, args []ir.Element) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewOptionVariable ¶
func NewOptionVariable(vr *ir.VarExpr) options.PackageOption
NewOptionVariable creates a package option to set a static variable of a package with its corresponding symbolic element.
Types ¶
type CompEval ¶
type CompEval struct {
// contains filtered or unexported fields
}
CompEval is the evaluator used for compilation evaluation.
func NewHostEvaluator ¶
NewHostEvaluator returns a new evaluator for the host.
func (*CompEval) ElementFromAtom ¶
func (ev *CompEval) ElementFromAtom(ctx ir.Evaluator, src ir.AssignableExpr, val values.Array) (evaluator.NumericalElement, error)
ElementFromAtom returns an element from a GX value.
func (*CompEval) NewFunc ¶
func (ev *CompEval) NewFunc(itp *interp.Interpreter, fn ir.PkgFunc, recv *interp.Receiver) interp.Func
NewFunc creates a new function given its definition and a receiver.
func (*CompEval) NewFuncLit ¶ added in v0.3.0
NewFuncLit creates a new function literal.
Directories
¶
Path | Synopsis |
---|---|
Package cpevelements provides elements for the interpreter for compeval.
|
Package cpevelements provides elements for the interpreter for compeval. |
Click to show internal directories.
Click to hide internal directories.