langtools

package
v0.13.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 24, 2022 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	PermissiveCatalog    = &LocalCatalog{}
	DeterministicCatalog = &LocalCatalog{}
)

Functions

func CallFunction

func CallFunction(
	ctx context.Context,
	cat lang.Catalog,
	env *lang.RunEnv,
	v *apivalues.Value,
	args []*apivalues.Value,
	kws map[string]*apivalues.Value,
) (lang.Lang, *apivalues.Value, *apilang.RunSummary, error)

func CompileModule

func CompileModule(ctx context.Context, cat lang.Catalog, predecls []string, path *apiprogram.Path, src []byte) (_ *apiprogram.Module, ext string, _ error)

func GetModuleDependencies

func GetModuleDependencies(ctx context.Context, cat lang.Catalog, mod *apiprogram.Module) ([]*apiprogram.Path, error)

func IsCompilerVersionSupported

func IsCompilerVersionSupported(ctx context.Context, cat lang.Catalog, lang, ver string) (bool, error)

func NewGRPCCatalog

func NewGRPCCatalog(ctx context.Context, l L.L, client pblangsvc.LangClient, runClient pblangsvc.LangRunClient) (lang.Catalog, error)

func NewGRPCCatalogFromConn

func NewGRPCCatalogFromConn(ctx context.Context, l L.L, conn *grpc.ClientConn) (lang.Catalog, error)

func NewInMemoryLoader

func NewInMemoryLoader(
	mods []*apiprogram.Module,
	load lang.LoadFunc,
	run func(context.Context, *apiprogram.Module) (map[string]*apivalues.Value, *apilang.RunSummary, error),
) lang.LoadFunc

func PathToRegisteredLang

func PathToRegisteredLang(cat lang.Catalog, path string) (lang_, ext string, err error)

func RejectCycles

func RejectCycles(load lang.LoadFunc) lang.LoadFunc

func RunModule

func RunModule(
	ctx context.Context,
	cat lang.Catalog,
	env *lang.RunEnv,
	mod *apiprogram.Module,
) (lang.Lang, map[string]*apivalues.Value, *apilang.RunSummary, error)

func RunModules

func RunModules(
	ctx context.Context,
	cat lang.Catalog,
	env *lang.RunEnv,
	mods []*apiprogram.Module,
) (map[string]*apivalues.Value, *apilang.RunSummary, error)

func SplitExtension

func SplitExtension(cat lang.Catalog, path string) (base, ext string)

Types

type LocalCatalog

type LocalCatalog struct {
	L     L.Nullable
	Langs map[string]*langent
}

func (*LocalCatalog) Acquire

func (c *LocalCatalog) Acquire(name, scope string) (lang.Lang, error)

func (*LocalCatalog) List

func (c *LocalCatalog) List() map[string][]string

func (*LocalCatalog) Register

func (c *LocalCatalog) Register(name string, l lang.CatalogLang)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL