Versions in this module Expand all Collapse all v0 v0.0.2 Nov 3, 2023 Changes in this version + var AnyIndex = anyIndex + var AnyString = anyString + var ErrAbove = errors.New("value was rounded up") + var ErrBelow = errors.New("value was rounded down") + var ErrInfinite = errors.New("infinite") + type AttrKind int + const DeclAttr + const FieldAttr + const ValueAttr + type Attribute struct + func (a *Attribute) Arg(i int) (key, value string) + func (a *Attribute) Contents() string + func (a *Attribute) Err() error + func (a *Attribute) Flag(pos int, key string) (bool, error) + func (a *Attribute) Int(pos int) (int64, error) + func (a *Attribute) Kind() AttrKind + func (a *Attribute) Lookup(pos int, key string) (val string, found bool, err error) + func (a *Attribute) Name() string + func (a *Attribute) NumArgs() int + func (a *Attribute) RawArg(i int) string + func (a *Attribute) String(pos int) (string, error) + func (a Attribute) Format(w fmt.State, verb rune) + type BuildOption func(o *runtime.Config) + func Filename(filename string) BuildOption + func ImportPath(path string) BuildOption + func InferBuiltins(elide bool) BuildOption + func Scope(scope Value) BuildOption + type Context runtime.Runtime + func (c *Context) BuildExpr(x ast.Expr, options ...BuildOption) Value + func (c *Context) BuildFile(f *ast.File, options ...BuildOption) Value + func (c *Context) BuildInstance(i *build.Instance, options ...BuildOption) Value + func (c *Context) BuildInstances(instances []*build.Instance) ([]Value, error) + func (c *Context) CompileBytes(b []byte, options ...BuildOption) Value + func (c *Context) CompileString(src string, options ...BuildOption) Value + func (c *Context) Encode(x interface{}, option ...EncodeOption) Value + func (c *Context) EncodeType(x interface{}, option ...EncodeOption) Value + func (c *Context) NewList(v ...Value) Value + type EncodeOption func(*encodeOptions) + func NilIsAny(isAny bool) EncodeOption + type FieldInfo struct + IsDefinition bool + IsHidden bool + IsOptional bool + Name string + Pos int + Selector string + SelectorType SelectorType + Value Value + type Instance struct + Dir string + DisplayName string + Err errors.Error + ImportPath string + Incomplete bool + PkgName string + func Build(instances []*build.Instance) []*Instance + func Merge(inst ...*Instance) *Instance + func (inst *Instance) ID() string + func (inst *Instance) Value() Value + type InstanceOrValue interface + Value func() Value + type Iterator struct + func (i *Iterator) FieldType() SelectorType + func (i *Iterator) IsOptional() bool + func (i *Iterator) Next() bool + func (i *Iterator) Selector() Selector + func (i *Iterator) Value() Value + type Kind = adt.Kind + const BoolKind + const BottomKind + const BytesKind + const FloatKind + const IntKind + const ListKind + const NullKind + const NumberKind + const StringKind + const StructKind + const TopKind + type Op = adt.Op + const AddOp + const AndOp + const BooleanAndOp + const BooleanOrOp + const CallOp + const EqualOp + const FloatQuotientOp + const GreaterThanEqualOp + const GreaterThanOp + const IndexOp + const IntDivideOp + const IntModuloOp + const IntQuotientOp + const IntRemainderOp + const InterpolationOp + const LessThanEqualOp + const LessThanOp + const MultiplyOp + const NoOp + const NotEqualOp + const NotOp + const NotRegexMatchOp + const OrOp + const RegexMatchOp + const SelectorOp + const SliceOp + const SubtractOp + type Option option + func All() Option + func Attributes(include bool) Option + func Concrete(concrete bool) Option + func Definitions(include bool) Option + func DisallowCycles(disallow bool) Option + func Docs(include bool) Option + func ErrorsAsValues(show bool) Option + func Final() Option + func Hidden(include bool) Option + func InlineImports(expand bool) Option + func Optional(include bool) Option + func Raw() Option + func ResolveReferences(resolve bool) Option + func Schema() Option + type Path struct + func MakePath(selectors ...Selector) Path + func ParsePath(s string) Path + func (p Path) Err() error + func (p Path) Optional() Path + func (p Path) Selectors() []Selector + func (p Path) String() string + type Runtime runtime.Runtime + func (r *Runtime) Marshal(instances ...*Instance) (b []byte, err error) + func (r *Runtime) Unmarshal(b []byte) ([]*Instance, error) + type Selector struct + func Def(s string) Selector + func Hid(name, pkg string) Selector + func Index(x int) Selector + func Label(label ast.Label) Selector + func Str(s string) Selector + func (sel Selector) ConstraintType() SelectorType + func (sel Selector) Index() int + func (sel Selector) IsConstraint() bool + func (sel Selector) IsDefinition() bool + func (sel Selector) IsString() bool + func (sel Selector) LabelType() SelectorType + func (sel Selector) Optional() Selector + func (sel Selector) PkgPath() string + func (sel Selector) Required() Selector + func (sel Selector) String() string + func (sel Selector) Type() SelectorType + func (sel Selector) Unquoted() string + type SelectorType uint16 + const DefinitionLabel + const HiddenDefinitionLabel + const HiddenLabel + const IndexLabel + const InvalidSelectorType + const OptionalConstraint + const PatternConstraint + const RequiredConstraint + const StringLabel + func (t SelectorType) ConstraintType() SelectorType + func (t SelectorType) IsDefinition() bool + func (t SelectorType) IsHidden() bool + func (t SelectorType) LabelType() SelectorType + func (t SelectorType) String() string + type Struct struct + type Value struct + func Dereference(v Value) Value + func (v Value) Allows(sel Selector) bool + func (v Value) AppendFloat(buf []byte, fmt byte, prec int) ([]byte, error) + func (v Value) AppendInt(buf []byte, base int) ([]byte, error) + func (v Value) Attribute(key string) Attribute + func (v Value) Attributes(mask AttrKind) []Attribute + func (v Value) Bool() (bool, error) + func (v Value) BuildInstance() *build.Instance + func (v Value) Bytes() ([]byte, error) + func (v Value) Context() *Context + func (v Value) Decode(x interface{}) error + func (v Value) Default() (Value, bool) + func (v Value) Doc() []*ast.CommentGroup + func (v Value) Equals(other Value) bool + func (v Value) Err() error + func (v Value) Eval() Value + func (v Value) Exists() bool + func (v Value) Expr() (Op, []Value) + func (v Value) Fields(opts ...Option) (*Iterator, error) + func (v Value) FillPath(p Path, x interface{}) Value + func (v Value) Float64() (float64, error) + func (v Value) Format(state fmt.State, verb rune) + func (v Value) IncompleteKind() Kind + func (v Value) Int(z *big.Int) (*big.Int, error) + func (v Value) Int64() (int64, error) + func (v Value) IsConcrete() bool + func (v Value) Kind() Kind + func (v Value) Len() Value + func (v Value) List() (Iterator, error) + func (v Value) LookupPath(p Path) Value + func (v Value) MantExp(mant *big.Int) (exp int, err error) + func (v Value) MarshalJSON() (b []byte, err error) + func (v Value) Null() error + func (v Value) Path() Path + func (v Value) Pos() token.Pos + func (v Value) ReferencePath() (root Value, p Path) + func (v Value) Source() ast.Node + func (v Value) String() (string, error) + func (v Value) Subsume(w Value, opts ...Option) error + func (v Value) Syntax(opts ...Option) ast.Node + func (v Value) Uint64() (uint64, error) + func (v Value) Unify(w Value) Value + func (v Value) UnifyAccept(w Value, accept Value) Value + func (v Value) Validate(opts ...Option) error + func (v Value) Walk(before func(Value) bool, after func(Value))