cue/ast: add NewStruct helper

Change-Id: Ie6acb637416a2be06325362346b6aad0bc702ed7
Reviewed-on: https://cue-review.googlesource.com/c/cue/+/4902
Reviewed-by: Marcel van Lohuizen <mpvl@golang.org>
diff --git a/encoding/jsonschema/decode.go b/encoding/jsonschema/decode.go
index c644ff0..afa502d 100644
--- a/encoding/jsonschema/decode.go
+++ b/encoding/jsonschema/decode.go
@@ -226,9 +226,7 @@
 				add(ast.NewList(&ast.Ellipsis{}))
 			}
 		case "object":
-			elps := &ast.Ellipsis{}
-			st := &ast.StructLit{Elts: []ast.Decl{elps}}
-			add(st)
+			add(ast.NewStruct(&ast.Ellipsis{}))
 		default:
 			s.errf(n, "unknown type %q", n)
 		}