Skip to content

Commit

Permalink
cue: add more godoc links
Browse files Browse the repository at this point in the history
While here, remove an unused parameter which was always nil.

Signed-off-by: Daniel Martí <[email protected]>
Change-Id: I6ec58c7adb0bb8d6fd24b2068ff71e6f4a652d9e
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1205531
Unity-Result: CUE porcuepine <[email protected]>
TryBot-Result: CUEcueckoo <[email protected]>
Reviewed-by: Matthew Sackman <[email protected]>
  • Loading branch information
mvdan committed Dec 11, 2024
1 parent 54dc544 commit 0e99c20
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion cue/build/instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ func (inst *Instance) addImport(imp *Instance) {
// It does not process the file's imports. The package name of the file must
// match the package name of the instance.
//
// Deprecated: use AddSyntax or wait for this to be renamed using a new
// Deprecated: use [Instance.AddSyntax] or wait for this to be renamed using a new
// signature.
func (inst *Instance) AddFile(filename string, src interface{}) error {
file, err := inst.parse(filename, src)
Expand Down
2 changes: 1 addition & 1 deletion cue/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ func str(c *adt.OpContext, v adt.Node) string {

// eval returns the evaluated value. This may not be the vertex.
//
// Deprecated: use ctx.value
// Deprecated: use [adt.OpContext.value].
func (v Value) eval(ctx *adt.OpContext) adt.Value {
if v.v == nil {
panic("undefined value")
Expand Down
12 changes: 6 additions & 6 deletions cue/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,7 @@ func remakeValue(base Value, env *adt.Environment, v adt.Expr) Value {
return makeChildValue(base.parent(), n)
}

func remakeFinal(base Value, env *adt.Environment, v adt.Value) Value {
func remakeFinal(base Value, v adt.Value) Value {
n := &adt.Vertex{Parent: base.v.Parent, Label: base.v.Label, BaseValue: v}
n.ForceDone()
return makeChildValue(base.parent(), n)
Expand Down Expand Up @@ -1092,7 +1092,7 @@ func (v Value) checkKind(ctx *adt.OpContext, want adt.Kind) *adt.Bottom {
func makeInt(v Value, x int64) Value {
n := &adt.Num{K: adt.IntKind}
n.X.SetInt64(int64(x))
return remakeFinal(v, nil, n)
return remakeFinal(v, n)
}

// Len returns the number of items of the underlying value.
Expand All @@ -1106,7 +1106,7 @@ func (v Value) Len() Value {
n := &adt.Num{K: adt.IntKind}
n.X.SetInt64(int64(len(x.Elems())))
if x.IsClosedList() {
return remakeFinal(v, nil, n)
return remakeFinal(v, n)
}
// Note: this HAS to be a Conjunction value and cannot be
// an adt.BinaryExpr, as the expressions would be considered
Expand All @@ -1116,7 +1116,7 @@ func (v Value) Len() Value {
&adt.BasicType{K: adt.IntKind},
&adt.BoundValue{Op: adt.GreaterEqualOp, Value: n},
}}
return remakeFinal(v, nil, c)
return remakeFinal(v, c)

}
case *adt.Bytes:
Expand Down Expand Up @@ -1329,7 +1329,7 @@ type hiddenStruct = Struct
// Deprecated: only used by deprecated functions.
type FieldInfo struct {
Selector string
Name string // Deprecated: use Selector
Name string // Deprecated: use [FieldInfo.Selector]
Pos int
Value Value

Expand Down Expand Up @@ -1968,7 +1968,7 @@ func Schema() Option {

// Concrete ensures that all values are concrete.
//
// For Validate this means it returns an error if this is not the case.
// For [Validate] this means it returns an error if this is not the case.
// In other cases a non-concrete value will be replaced with an error.
func Concrete(concrete bool) Option {
return func(p *options) {
Expand Down

0 comments on commit 0e99c20

Please sign in to comment.