Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrLangNotRegistered = errors.New("lang not registered") ErrCompilerVersionMismatch = errors.New("compiler version mismatch") ErrUnsupportedCompilerVersion = errors.New("unsupported compiler version") ErrExtensionNotRegistered = errors.New("extension not registered") )
View Source
var EmptyRunEnv = RunEnv{ Print: func(string) {}, Load: func(context.Context, *apiprogram.Path) (map[string]*apivalues.Value, *apilang.RunSummary, error) { return nil, nil, errors.New("load is not supported") }, Call: func(context.Context, *apivalues.Value, map[string]*apivalues.Value, []*apivalues.Value, *apilang.RunSummary) (*apivalues.Value, error) { return nil, errors.New("call is not supported") }, }
Functions ¶
This section is empty.
Types ¶
type CatalogLang ¶
type CatalogLang struct { New NewLangFunc Exts []string // extensions without the prefix dot. }
type ErrCanceled ¶
type ErrCanceled struct{ CallStack []*apiprogram.CallFrame }
func (*ErrCanceled) Error ¶
func (e *ErrCanceled) Error() string
func (*ErrCanceled) Unwrap ¶
func (e *ErrCanceled) Unwrap() error
type ErrMissingDependencies ¶
type ErrMissingDependencies []*apiprogram.Path
func (ErrMissingDependencies) Error ¶
func (err ErrMissingDependencies) Error() string
type Lang ¶
type Lang interface { IsCompilerVersionSupported(context.Context, string) (bool, error) CompileModule( _ context.Context, path *apiprogram.Path, src []byte, predecls []string, ) (*apiprogram.Module, error) GetModuleDependencies(context.Context, *apiprogram.Module) ([]*apiprogram.Path, error) // In case of cancellation, will return ErrCanceled{Callstack: ...}. RunModule( ctx context.Context, env *RunEnv, mod *apiprogram.Module, ) (map[string]*apivalues.Value, *apilang.RunSummary, error) // In case of cancellation, will return ErrCanceled{Callstack: ...}. CallFunction( ctx context.Context, env *RunEnv, fn *apivalues.Value, args []*apivalues.Value, kws map[string]*apivalues.Value, ) (*apivalues.Value, *apilang.RunSummary, error) }
type LoadFunc ¶
type LoadFunc func(context.Context, *apiprogram.Path) (map[string]*apivalues.Value, *apilang.RunSummary, error)
Directories ¶
Path | Synopsis |
---|---|
starlarktest
Adapted from https://github.com/google/starlark-go/blob/master/starlarktest/starlarktest.go.
|
Adapted from https://github.com/google/starlark-go/blob/master/starlarktest/starlarktest.go. |
Click to show internal directories.
Click to hide internal directories.