| 27 | } |
| 28 | |
| 29 | func (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 | |
| 49 | func (e exprWrap) Value(ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) { |
| 50 | if e.i == nil { |