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

package export

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

Index

Package Files

adt.go bounds.go export.go expr.go extract.go label.go quote.go toposort.go value.go

Variables

var All = &Profile{
    Simplify:        true,
    ShowOptional:    true,
    ShowDefinitions: true,
    ShowHidden:      true,
    ShowDocs:        true,
    ShowAttributes:  true,
}
var Final = &Profile{
    Simplify:     true,
    TakeDefaults: true,
}
var Raw = &Profile{
    ShowOptional:    true,
    ShowDefinitions: true,
    ShowHidden:      true,
    ShowDocs:        true,
}
var Simplified = &Profile{
    Simplify: true,
    ShowDocs: true,
}

func Def Uses

func Def(r adt.Runtime, v *adt.Vertex) (*ast.File, errors.Error)

Def exports v as a definition.

func Expr Uses

func Expr(r adt.Runtime, n adt.Expr) (ast.Expr, errors.Error)

func ExtractDoc Uses

func ExtractDoc(v *adt.Vertex) (docs []*ast.CommentGroup)

ExtractDoc collects documentation strings for a field.

Comments are attached to a field with a field shorthand belong to the child node. So in the following the comment is attached to field bar.

// comment
foo: bar: 2

func ExtractFieldAttrs Uses

func ExtractFieldAttrs(a []adt.Conjunct) (attrs []*ast.Attribute)

func Value Uses

func Value(r adt.Runtime, n adt.Value) (ast.Expr, errors.Error)

func Vertex Uses

func Vertex(r adt.Runtime, n *adt.Vertex) (*ast.File, errors.Error)

func VertexFeatures Uses

func VertexFeatures(v *adt.Vertex) []adt.Feature

VertexFeatures returns the feature list of v. The list may include more features than for which there are arcs and also includes features for optional fields. It assumes the Structs fields is properly initialized.

type Profile Uses

type Profile struct {
    Simplify bool

    // TakeDefaults is used in Value mode to drop non-default values.
    TakeDefaults bool

    // TODO:
    // IncludeDocs
    ShowOptional    bool
    ShowDefinitions bool
    ShowHidden      bool
    ShowDocs        bool
    ShowAttributes  bool
}

func (*Profile) Def Uses

func (p *Profile) Def(r adt.Runtime, v *adt.Vertex) (*ast.File, errors.Error)

Def exports v as a definition.

func (*Profile) Expr Uses

func (p *Profile) Expr(r adt.Runtime, n adt.Expr) (ast.Expr, errors.Error)

func (*Profile) Value Uses

func (p *Profile) Value(r adt.Runtime, n adt.Value) (ast.Expr, errors.Error)

Should take context.

func (*Profile) Vertex Uses

func (p *Profile) Vertex(r adt.Runtime, n *adt.Vertex) (*ast.File, errors.Error)

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