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

Method Variables

ext/dynblock/expr_wrap.go:29–47  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

27}
28
29func (e exprWrap) Variables() []hcl.Traversal {
30 raw := e.Expression.Variables()
31 ret := make([]hcl.Traversal, 0, len(raw))
32
33 // Filter out traversals that refer to our iterator name or any
34 // iterator we've inherited; we're going to provide those in
35 // our Value wrapper, so the caller doesn't need to know about them.
36 for _, traversal := range raw {
37 rootName := traversal.RootName()
38 if rootName == e.i.IteratorName {
39 continue
40 }
41 if _, inherited := e.i.Inherited[rootName]; inherited {
42 continue
43 }
44 ret = append(ret, traversal)
45 }
46 return ret
47}
48
49func (e exprWrap) Value(ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) {
50 if e.i == nil {

Callers

nothing calls this directly

Calls 2

VariablesMethod · 0.65
RootNameMethod · 0.45

Tested by

no test coverage detected