Documentation
¶
Overview ¶
Package yaegicore provides functions connecting https://github.com/cogentcore/yaegi to Cogent Core.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Interpreters = map[string]func(options interp.Options) Interpreter{ "Go": func(options interp.Options) Interpreter { return interp.New(options) }, }
Interpreters is a map from language names (such as "Go") to functions that create a new Interpreter for that language. The base implementation is just interp.Interpreter for Go, but other packages can extend this. See the Interpreter interface for more information.
Functions ¶
func BindTextEditor ¶
func BindTextEditor(ed *texteditor.Editor, parent *core.Frame, language string)
BindTextEditor binds the given text editor to a yaegi interpreter such that the contents of the text editor are interpreted as code of the given language, which is run in the context of the given parent widget. It is used as the default value of htmlcore.BindTextEditor.
Types ¶
type Interpreter ¶ added in v0.3.8
type Interpreter interface { // Use imports the given symbols into the interpreter. Use(values interp.Exports) error // ImportUsed imports the used symbols into the interpreter // and does any extra necessary configuration steps. ImportUsed() // Eval evaluates the given code in the interpreter. Eval(src string) (res reflect.Value, err error) }
Interpreter is an interface that represents the functionality provided by an interpreter compatible with yaegicore. The base implementation is just interp.Interpreter, but other packages such as yaegilab in Cogent Lab provide their own implementations with other languages such as Cogent Goal. See Interpreters.
Directories
¶
Path | Synopsis |
---|---|
Package basesymbols contains yaegi symbols for base (non-GUI) packages.
|
Package basesymbols contains yaegi symbols for base (non-GUI) packages. |
Package coresymbols contains yaegi symbols for core packages.
|
Package coresymbols contains yaegi symbols for core packages. |