go: cuelang.org/go/internal/core/runtime Index | Files

package runtime

import "cuelang.org/go/internal/core/runtime"

Index

Package Files

errors.go index.go resolve.go runtime.go

Variables

var SharedIndex = newSharedIndex()

SharedIndex is used for indexing builtins and any other labels common to all instances.

var SharedIndexNew = newSharedIndex()
var SharedRuntimeNew = &Runtime{index: SharedIndexNew}

func ResolveFile Uses

func ResolveFile(
    idx *Index,
    f *ast.File,
    p *build.Instance,
    allFields map[string]ast.Node,
    isBuiltin func(s string) bool,
) errors.Error

func ResolveFiles Uses

func ResolveFiles(
    idx *Index,
    p *build.Instance,
    isBuiltin func(s string) bool,
) (errs errors.Error)

type Index Uses

type Index struct {
    // contains filtered or unexported fields
}

Index maps conversions from label names to internal codes.

All instances belonging to the same package should share this Index.

INDEX IS A TRANSITIONAL TYPE TO BRIDGE THE OLD AND NEW IMPLEMENTATIONS. USE RUNTIME.

func NewIndex Uses

func NewIndex(parent *Index) *Index

NewIndex creates a new index.

func (*Index) AddInst Uses

func (x *Index) AddInst(path string, key, p interface{})

func (*Index) GetImportFromNode Uses

func (x *Index) GetImportFromNode(key interface{}) interface{}

func (*Index) GetImportFromPath Uses

func (x *Index) GetImportFromPath(id string) interface{}

func (*Index) HasLabel Uses

func (x *Index) HasLabel(s string) (ok bool)

func (*Index) IndexToString Uses

func (x *Index) IndexToString(i int64) string

func (*Index) Label Uses

func (x *Index) Label(s string, isIdent bool) adt.Feature

func (*Index) LabelStr Uses

func (idx *Index) LabelStr(l adt.Feature) string

func (*Index) LoadType Uses

func (x *Index) LoadType(t reflect.Type) (v interface{}, ok bool)

func (*Index) NodeLabel Uses

func (x *Index) NodeLabel(n ast.Node) (f adt.Feature, ok bool)

func (*Index) StoreType Uses

func (x *Index) StoreType(t reflect.Type, v interface{})

func (*Index) StrLabel Uses

func (x *Index) StrLabel(str string) adt.Feature

func (*Index) StringToIndex Uses

func (x *Index) StringToIndex(s string) int64

type Runtime Uses

type Runtime struct {

    // Data holds the legacy index strut. It is for transitional purposes only.
    Data interface{}
    // contains filtered or unexported fields
}

A Runtime maintains data structures for indexing and resuse for evaluation.

func New Uses

func New() *Runtime

New creates a new Runtime.

func NewWithIndex Uses

func NewWithIndex(x *Index) *Runtime

func (*Runtime) Build Uses

func (x *Runtime) Build(b *build.Instance) (v *adt.Vertex, errs errors.Error)

func (*Runtime) IndexToString Uses

func (x *Runtime) IndexToString(i int64) string

func (*Runtime) LoadImport Uses

func (x *Runtime) LoadImport(importPath string) (*adt.Vertex, errors.Error)

func (*Runtime) LoadType Uses

func (x *Runtime) LoadType(t reflect.Type) (src ast.Expr, expr adt.Expr, ok bool)

func (*Runtime) StoreType Uses

func (x *Runtime) StoreType(t reflect.Type, src ast.Expr, expr adt.Expr)

func (*Runtime) StringToIndex Uses

func (x *Runtime) StringToIndex(s string) int64

Package runtime imports 13 packages (graph) and is imported by 4 packages. Updated 2020-09-28. Refresh now. Tools for package owners.