compiler.Value abstraction for docstring and incompletekind

Signed-off-by: Sam Alba <sam.alba@gmail.com>
This commit is contained in:
Sam Alba
2021-06-02 11:42:59 +02:00
parent fd31afeda0
commit 66929f8a63
3 changed files with 11 additions and 11 deletions

View File

@@ -5,6 +5,7 @@ import (
"strconv"
"cuelang.org/go/cue"
"cuelang.org/go/cue/ast"
cueformat "cuelang.org/go/cue/format"
)
@@ -270,3 +271,11 @@ func (v *Value) Default() (*Value, bool) {
val, hasDef := v.val.Default()
return v.cc.Wrap(val), hasDef
}
func (v *Value) Doc() []*ast.CommentGroup {
return v.Cue().Doc()
}
func (v *Value) IncompleteKindString() string {
return v.Cue().IncompleteKind().String()
}