4 "github.com/hashicorp/hcl2/hcl"
5 "github.com/zclconf/go-cty/cty"
13 func (e exprWrap) Variables() []hcl.Traversal {
14 raw := e.Expression.Variables()
15 ret := make([]hcl.Traversal, 0, len(raw))
17 // Filter out traversals that refer to our iterator name or any
18 // iterator we've inherited; we're going to provide those in
19 // our Value wrapper, so the caller doesn't need to know about them.
20 for _, traversal := range raw {
21 rootName := traversal.RootName()
22 if rootName == e.i.IteratorName {
25 if _, inherited := e.i.Inherited[rootName]; inherited {
28 ret = append(ret, traversal)
33 func (e exprWrap) Value(ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) {
34 extCtx := e.i.EvalContext(ctx)
35 return e.Expression.Value(extCtx)
38 // UnwrapExpression returns the expression being wrapped by this instance.
39 // This allows the original expression to be recovered by hcl.UnwrapExpression.
40 func (e exprWrap) UnwrapExpression() hcl.Expression {