|
|
|
@ -256,6 +256,7 @@ func Parse(b hcl.Body, opt Opt, val interface{}) hcl.Diagnostics {
|
|
|
|
|
if err := gohcl.DecodeBody(b, nil, &defs); err != nil {
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
defsSchema, _ := gohcl.ImpliedBodySchema(defs)
|
|
|
|
|
|
|
|
|
|
if opt.LookupVar == nil {
|
|
|
|
|
opt.LookupVar = func(string) (string, bool) {
|
|
|
|
@ -300,6 +301,16 @@ func Parse(b hcl.Body, opt Opt, val interface{}) hcl.Diagnostics {
|
|
|
|
|
p.funcs[v.Name] = v
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
content, b, diags := b.PartialContent(schema)
|
|
|
|
|
if diags.HasErrors() {
|
|
|
|
|
return diags
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_, b, diags = b.PartialContent(defsSchema)
|
|
|
|
|
if diags.HasErrors() {
|
|
|
|
|
return diags
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
attrs, diags := b.JustAttributes()
|
|
|
|
|
if diags.HasErrors() {
|
|
|
|
|
if d := removeAttributesDiags(diags, reserved, p.vars); len(d) > 0 {
|
|
|
|
@ -371,11 +382,6 @@ func Parse(b hcl.Body, opt Opt, val interface{}) hcl.Diagnostics {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
content, _, diags := b.PartialContent(schema)
|
|
|
|
|
if diags.HasErrors() {
|
|
|
|
|
return diags
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for _, a := range content.Attributes {
|
|
|
|
|
return hcl.Diagnostics{
|
|
|
|
|
&hcl.Diagnostic{
|
|
|
|
|