Documentation
¶
Index ¶
- type Config
- type Evaluator
- func (e *Evaluator) ApplyFunction(call *ast.CallExpr, fn object.Object, args []object.Object, ...) object.Object
- func (e *Evaluator) Eval(node ast.Node, env *object.Environment, fscope *object.FileScope) object.Object
- func (e *Evaluator) EvalToplevel(decls []object.DeclWithScope, env *object.Environment) object.Object
- func (e *Evaluator) Scanner() *goscan.Scanner
- func (e *Evaluator) WrapGoFunction(pos token.Pos, funcVal reflect.Value) object.Object
- type SpecialForm
- type SpecialFormFunction
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Fset *token.FileSet Scanner *goscan.Scanner Registry *object.SymbolRegistry SpecialForms map[string]*SpecialForm Packages map[string]*object.Package Stdin io.Reader Stdout io.Writer Stderr io.Writer }
Config holds the configuration for creating a new Evaluator.
type Evaluator ¶
type Evaluator struct { object.BuiltinContext // contains filtered or unexported fields }
Evaluator is the main object that evaluates the AST.
func (*Evaluator) ApplyFunction ¶
func (e *Evaluator) ApplyFunction(call *ast.CallExpr, fn object.Object, args []object.Object, fscope *object.FileScope) object.Object
ApplyFunction is a public wrapper for the internal applyFunction, allowing it to be called from other packages.
func (*Evaluator) EvalToplevel ¶
func (e *Evaluator) EvalToplevel(decls []object.DeclWithScope, env *object.Environment) object.Object
EvalToplevel orchestrates the two-pass evaluation for a set of declarations from one or more files.
type SpecialForm ¶
type SpecialForm struct {
Fn SpecialFormFunction
}
SpecialForm represents a special form function.
func (*SpecialForm) Inspect ¶
func (sf *SpecialForm) Inspect() string
Inspect returns a string representation of the special form function.
func (*SpecialForm) Type ¶
func (sf *SpecialForm) Type() object.ObjectType
Type returns the type of the SpecialForm object.
Click to show internal directories.
Click to hide internal directories.