specNeedingVariables implementation
(content *hcl.BodyContent)
| 334 | |
| 335 | // specNeedingVariables implementation |
| 336 | func (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 | |
| 354 | func (s *BlockSpec) decode(content *hcl.BodyContent, blockLabels []blockLabel, ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) { |
| 355 | var diags hcl.Diagnostics |
nothing calls this directly
no test coverage detected