cue: support export package clause and docs

Change-Id: I5db5b8e8bc6180061334c230770a20c4cadb6949
Reviewed-on: https://cue-review.googlesource.com/c/cue/+/5092
Reviewed-by: Marcel van Lohuizen <mpvl@golang.org>
diff --git a/encoding/jsonschema/decode.go b/encoding/jsonschema/decode.go
index 33cb400..56fd6cc 100644
--- a/encoding/jsonschema/decode.go
+++ b/encoding/jsonschema/decode.go
@@ -123,7 +123,7 @@
 }
 
 func (d *decoder) number(n cue.Value) ast.Expr {
-	return n.Syntax().(ast.Expr)
+	return n.Syntax(cue.Final()).(ast.Expr)
 }
 
 func (d *decoder) uint(n cue.Value) ast.Expr {
@@ -131,11 +131,11 @@
 	if err != nil {
 		d.errf(n, "invalid uint")
 	}
-	return n.Syntax().(ast.Expr)
+	return n.Syntax(cue.Final()).(ast.Expr)
 }
 
 func (d *decoder) bool(n cue.Value) ast.Expr {
-	return n.Syntax().(ast.Expr)
+	return n.Syntax(cue.Final()).(ast.Expr)
 }
 
 func (d *decoder) boolValue(n cue.Value) bool {
@@ -147,7 +147,7 @@
 }
 
 func (d *decoder) string(n cue.Value) ast.Expr {
-	return n.Syntax().(ast.Expr)
+	return n.Syntax(cue.Final()).(ast.Expr)
 }
 
 func (d *decoder) strValue(n cue.Value) (s string, ok bool) {
@@ -343,7 +343,7 @@
 		if !n.IsConcrete() {
 			s.errf(n, "invalid non-concerte value")
 		}
-		return n.Syntax().(ast.Expr)
+		return n.Syntax(cue.Final()).(ast.Expr)
 	}
 }