Skip to content

Commit

Permalink
internal: remove a few unused APIs
Browse files Browse the repository at this point in the history
None of these four APIs has been used for over two years at this point.
They are always available in the git history if needed.

Signed-off-by: Daniel Martí <[email protected]>
Change-Id: I1c11e7c45227f792d2d4e4f3069765f271d1aded
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/556611
Reviewed-by: Roger Peppe <[email protected]>
Unity-Result: CUE porcuepine <[email protected]>
TryBot-Result: CUEcueckoo <[email protected]>
  • Loading branch information
mvdan committed Jul 14, 2023
1 parent c10d7cb commit 1c1a7b3
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 44 deletions.
8 changes: 0 additions & 8 deletions internal/core/adt/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,6 @@ func init() {
log.SetFlags(log.Lshortfile)
}

func Logf(format string, args ...interface{}) {
if Verbosity == 0 {
return
}
s := fmt.Sprintf(format, args...)
_ = log.Output(2, s)
}

var pMap = map[*Vertex]int{}

func (c *OpContext) Logf(v *Vertex, format string, args ...interface{}) {
Expand Down
27 changes: 0 additions & 27 deletions internal/internal.go
Original file line number Diff line number Diff line change
Expand Up @@ -325,33 +325,6 @@ func ToFile(n ast.Node) *ast.File {
}
}

// ToStruct gets the non-preamble declarations of a file and puts them in a
// struct.
func ToStruct(f *ast.File) *ast.StructLit {
start := 0
for i, d := range f.Decls {
switch d.(type) {
case *ast.Package, *ast.ImportDecl:
start = i + 1
case *ast.Attribute, *ast.CommentGroup:
default:
break
}
}
s := ast.NewStruct()
s.Elts = f.Decls[start:]
return s
}

func IsBulkField(d ast.Decl) bool {
if f, ok := d.(*ast.Field); ok {
if _, ok := f.Label.(*ast.ListLit); ok {
return true
}
}
return false
}

func IsDef(s string) bool {
return strings.HasPrefix(s, "#") || strings.HasPrefix(s, "_#")
}
Expand Down
9 changes: 0 additions & 9 deletions internal/value/value.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
"strings"

"cuelang.org/go/cue"
"cuelang.org/go/cue/errors"
"cuelang.org/go/internal/core/adt"
"cuelang.org/go/internal/core/convert"
"cuelang.org/go/internal/core/eval"
Expand Down Expand Up @@ -50,14 +49,6 @@ func Make(ctx *adt.OpContext, v adt.Value) cue.Value {
return (*cue.Context)(ctx.Impl().(*runtime.Runtime)).Encode(v)
}

func MakeError(r *runtime.Runtime, err errors.Error) cue.Value {
b := &adt.Bottom{Err: err}
node := &adt.Vertex{BaseValue: b}
node.ForceDone()
node.AddConjunct(adt.MakeRootConjunct(nil, b))
return (*cue.Context)(r).Encode(node)
}

// UnifyBuiltin returns the given Value unified with the given builtin template.
func UnifyBuiltin(v cue.Value, kind string) cue.Value {
p := strings.Split(kind, ".")
Expand Down

0 comments on commit 1c1a7b3

Please sign in to comment.