X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;ds=sidebyside;f=vendor%2Fgithub.com%2Fhashicorp%2Fhcl2%2Fhcl%2Fhclsyntax%2Fparser.go;h=772ebae2bc60e9190466dda2eaaef59c983e39d5;hb=refs%2Fheads%2Fadd_contact_groups;hp=253ad5031a2550406c89b1be7105a47578577b16;hpb=3cd2d4f34aefe6090b287b2b4c26049819414e46;p=github%2Ffretlink%2Fterraform-provider-statuscake.git diff --git a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/parser.go b/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/parser.go index 253ad50..772ebae 100644 --- a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/parser.go +++ b/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/parser.go @@ -853,6 +853,14 @@ Traversal: SrcRange: rng, } ret = makeRelativeTraversal(ret, step, rng) + } else if tmpl, isTmpl := keyExpr.(*TemplateExpr); isTmpl && tmpl.IsStringLiteral() { + litKey, _ := tmpl.Value(nil) + rng := hcl.RangeBetween(open.Range, close.Range) + step := hcl.TraverseIndex{ + Key: litKey, + SrcRange: rng, + } + ret = makeRelativeTraversal(ret, step, rng) } else { rng := hcl.RangeBetween(open.Range, close.Range) ret = &IndexExpr{