aboutsummaryrefslogtreecommitdiffhomepage
path: root/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/expression_template.go
diff options
context:
space:
mode:
authorAlexandre Garand <alexandre.garand@fretlink.com>2019-08-09 15:59:15 +0200
committerAlexandre Garand <alexandre.garand@fretlink.com>2019-08-09 16:39:21 +0200
commit863486a6b71ed0e562a3965bed56465d007b1418 (patch)
treee93f6a687695af86d54237ec9f575d4ef104222d /vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/expression_template.go
parent49c1c7b4dc69ffb9ab52330e6dc52ccdd6351087 (diff)
downloadterraform-provider-statuscake-863486a6b71ed0e562a3965bed56465d007b1418.tar.gz
terraform-provider-statuscake-863486a6b71ed0e562a3965bed56465d007b1418.tar.zst
terraform-provider-statuscake-863486a6b71ed0e562a3965bed56465d007b1418.zip
update vendor and go.modadd_contact_groups
Diffstat (limited to 'vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/expression_template.go')
-rw-r--r--vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/expression_template.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/expression_template.go b/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/expression_template.go
index fa79e3d..ca3dae1 100644
--- a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/expression_template.go
+++ b/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/expression_template.go
@@ -89,6 +89,26 @@ func (e *TemplateExpr) StartRange() hcl.Range {
89 return e.Parts[0].StartRange() 89 return e.Parts[0].StartRange()
90} 90}
91 91
92// IsStringLiteral returns true if and only if the template consists only of
93// single string literal, as would be created for a simple quoted string like
94// "foo".
95//
96// If this function returns true, then calling Value on the same expression
97// with a nil EvalContext will return the literal value.
98//
99// Note that "${"foo"}", "${1}", etc aren't considered literal values for the
100// purposes of this method, because the intent of this method is to identify
101// situations where the user seems to be explicitly intending literal string
102// interpretation, not situations that result in literals as a technicality
103// of the template expression unwrapping behavior.
104func (e *TemplateExpr) IsStringLiteral() bool {
105 if len(e.Parts) != 1 {
106 return false
107 }
108 _, ok := e.Parts[0].(*LiteralValueExpr)
109 return ok
110}
111
92// TemplateJoinExpr is used to convert tuples of strings produced by template 112// TemplateJoinExpr is used to convert tuples of strings produced by template
93// constructs (i.e. for loops) into flat strings, by converting the values 113// constructs (i.e. for loops) into flat strings, by converting the values
94// tos strings and joining them. This AST node is not used directly; it's 114// tos strings and joining them. This AST node is not used directly; it's