diff options
author | Nathan Dench <ndenc2@gmail.com> | 2019-05-24 15:16:44 +1000 |
---|---|---|
committer | Nathan Dench <ndenc2@gmail.com> | 2019-05-24 15:16:44 +1000 |
commit | 107c1cdb09c575aa2f61d97f48d8587eb6bada4c (patch) | |
tree | ca7d008643efc555c388baeaf1d986e0b6b3e28c /vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/diagnostics.go | |
parent | 844b5a68d8af4791755b8f0ad293cc99f5959183 (diff) | |
download | terraform-provider-statuscake-107c1cdb09c575aa2f61d97f48d8587eb6bada4c.tar.gz terraform-provider-statuscake-107c1cdb09c575aa2f61d97f48d8587eb6bada4c.tar.zst terraform-provider-statuscake-107c1cdb09c575aa2f61d97f48d8587eb6bada4c.zip |
Upgrade to 0.12
Diffstat (limited to 'vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/diagnostics.go')
-rw-r--r-- | vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/diagnostics.go | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/diagnostics.go b/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/diagnostics.go new file mode 100644 index 0000000..94eaf58 --- /dev/null +++ b/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/diagnostics.go | |||
@@ -0,0 +1,23 @@ | |||
1 | package hclsyntax | ||
2 | |||
3 | import ( | ||
4 | "github.com/hashicorp/hcl2/hcl" | ||
5 | ) | ||
6 | |||
7 | // setDiagEvalContext is an internal helper that will impose a particular | ||
8 | // EvalContext on a set of diagnostics in-place, for any diagnostic that | ||
9 | // does not already have an EvalContext set. | ||
10 | // | ||
11 | // We generally expect diagnostics to be immutable, but this is safe to use | ||
12 | // on any Diagnostics where none of the contained Diagnostic objects have yet | ||
13 | // been seen by a caller. Its purpose is to apply additional context to a | ||
14 | // set of diagnostics produced by a "deeper" component as the stack unwinds | ||
15 | // during expression evaluation. | ||
16 | func setDiagEvalContext(diags hcl.Diagnostics, expr hcl.Expression, ctx *hcl.EvalContext) { | ||
17 | for _, diag := range diags { | ||
18 | if diag.Expression == nil { | ||
19 | diag.Expression = expr | ||
20 | diag.EvalContext = ctx | ||
21 | } | ||
22 | } | ||
23 | } | ||