MCPcopy
hub / github.com/hashicorp/hcl / variablesNeeded

Method variablesNeeded

hcldec/spec.go:336–352  ·  view source on GitHub ↗

specNeedingVariables implementation

(content *hcl.BodyContent)

Source from the content-addressed store, hash-verified

334
335// specNeedingVariables implementation
336func (s *BlockSpec) variablesNeeded(content *hcl.BodyContent) []hcl.Traversal {
337 var childBlock *hcl.Block
338 for _, candidate := range content.Blocks {
339 if candidate.Type != s.TypeName {
340 continue
341 }
342
343 childBlock = candidate
344 break
345 }
346
347 if childBlock == nil {
348 return nil
349 }
350
351 return Variables(childBlock.Body, s.Nested)
352}
353
354func (s *BlockSpec) decode(content *hcl.BodyContent, blockLabels []blockLabel, ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) {
355 var diags hcl.Diagnostics

Callers

nothing calls this directly

Calls 1

VariablesFunction · 0.70

Tested by

no test coverage detected