vendor: go get github.com/hashicorp/hcl2@master

This includes two upstream fixes:

- Handle explicit JSON "null" consistently during decode of JSON syntax.
- Properly detect the end of a "heredoc" when formatting to avoid messing
  up indentation of other lines following the heredoc.
This commit is contained in:
Martin Atkins 2019-03-15 13:29:25 -07:00
parent b5b67a4592
commit ea1d5f8fcb
8 changed files with 12 additions and 10 deletions

View File

@ -11,5 +11,5 @@ EOF
} }
output "local" { output "local" {
value = local.cert_options value = local.cert_options
} }

View File

@ -8,5 +8,5 @@ EOF
} }
output "local" { output "local" {
value = local.cert_options value = local.cert_options
} }

View File

@ -12,5 +12,5 @@ EOF
} }
output "local" { output "local" {
value = local.cert_options value = local.cert_options
} }

2
go.mod
View File

@ -60,7 +60,7 @@ require (
github.com/hashicorp/go-version v1.1.0 github.com/hashicorp/go-version v1.1.0
github.com/hashicorp/golang-lru v0.5.0 // indirect github.com/hashicorp/golang-lru v0.5.0 // indirect
github.com/hashicorp/hcl v0.0.0-20170504190234-a4b07c25de5f github.com/hashicorp/hcl v0.0.0-20170504190234-a4b07c25de5f
github.com/hashicorp/hcl2 v0.0.0-20190226234159-7e26f2f34612 github.com/hashicorp/hcl2 v0.0.0-20190315201941-956e03eb6dda
github.com/hashicorp/hil v0.0.0-20190212112733-ab17b08d6590 github.com/hashicorp/hil v0.0.0-20190212112733-ab17b08d6590
github.com/hashicorp/logutils v1.0.0 github.com/hashicorp/logutils v1.0.0
github.com/hashicorp/memberlist v0.1.0 // indirect github.com/hashicorp/memberlist v0.1.0 // indirect

4
go.sum
View File

@ -200,8 +200,8 @@ github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ
github.com/hashicorp/hcl v0.0.0-20170504190234-a4b07c25de5f h1:UdxlrJz4JOnY8W+DbLISwf2B8WXEolNRA8BGCwI9jws= github.com/hashicorp/hcl v0.0.0-20170504190234-a4b07c25de5f h1:UdxlrJz4JOnY8W+DbLISwf2B8WXEolNRA8BGCwI9jws=
github.com/hashicorp/hcl v0.0.0-20170504190234-a4b07c25de5f/go.mod h1:oZtUIOe8dh44I2q6ScRibXws4Ajl+d+nod3AaR9vL5w= github.com/hashicorp/hcl v0.0.0-20170504190234-a4b07c25de5f/go.mod h1:oZtUIOe8dh44I2q6ScRibXws4Ajl+d+nod3AaR9vL5w=
github.com/hashicorp/hcl2 v0.0.0-20181208003705-670926858200/go.mod h1:ShfpTh661oAaxo7VcNxg0zcZW6jvMa7Moy2oFx7e5dE= github.com/hashicorp/hcl2 v0.0.0-20181208003705-670926858200/go.mod h1:ShfpTh661oAaxo7VcNxg0zcZW6jvMa7Moy2oFx7e5dE=
github.com/hashicorp/hcl2 v0.0.0-20190226234159-7e26f2f34612 h1:6r7kHL9FVohHX5vd/qvoLLV+BAbHjZKu0kjfgoT9CjE= github.com/hashicorp/hcl2 v0.0.0-20190315201941-956e03eb6dda h1:wgPsY2p0JDBRzc7fPEUidAhpXZzSPTIuSUDATOisbYs=
github.com/hashicorp/hcl2 v0.0.0-20190226234159-7e26f2f34612/go.mod h1:HtEzazM5AZ9fviNEof8QZB4T1Vz9UhHrGhnMPzl//Ek= github.com/hashicorp/hcl2 v0.0.0-20190315201941-956e03eb6dda/go.mod h1:HtEzazM5AZ9fviNEof8QZB4T1Vz9UhHrGhnMPzl//Ek=
github.com/hashicorp/hil v0.0.0-20190212112733-ab17b08d6590 h1:2yzhWGdgQUWZUCNK+AoO35V+HTsgEmcM4J9IkArh7PI= github.com/hashicorp/hil v0.0.0-20190212112733-ab17b08d6590 h1:2yzhWGdgQUWZUCNK+AoO35V+HTsgEmcM4J9IkArh7PI=
github.com/hashicorp/hil v0.0.0-20190212112733-ab17b08d6590/go.mod h1:n2TSygSNwsLJ76m8qFXTSc7beTb+auJxYdqrnoqwZWE= github.com/hashicorp/hil v0.0.0-20190212112733-ab17b08d6590/go.mod h1:n2TSygSNwsLJ76m8qFXTSc7beTb+auJxYdqrnoqwZWE=
github.com/hashicorp/logutils v1.0.0 h1:dLEQVugN8vlakKOUE3ihGLTZJRB4j+M2cdTm/ORI65Y= github.com/hashicorp/logutils v1.0.0 h1:dLEQVugN8vlakKOUE3ihGLTZJRB4j+M2cdTm/ORI65Y=

View File

@ -499,6 +499,8 @@ func (e *expression) Value(ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) {
return cty.DynamicVal, diags return cty.DynamicVal, diags
} }
return cty.ObjectVal(attrs), diags return cty.ObjectVal(attrs), diags
case *nullVal:
return cty.NullVal(cty.DynamicPseudoType), nil
default: default:
// Default to DynamicVal so that ASTs containing invalid nodes can // Default to DynamicVal so that ASTs containing invalid nodes can
// still be partially-evaluated. // still be partially-evaluated.

View File

@ -79,13 +79,13 @@ func formatIndent(lines []formatLine) {
netBrackets := 0 netBrackets := 0
for _, token := range line.lead { for _, token := range line.lead {
netBrackets += tokenBracketChange(token) netBrackets += tokenBracketChange(token)
}
for _, token := range line.assign {
netBrackets += tokenBracketChange(token)
if token.Type == hclsyntax.TokenOHeredoc { if token.Type == hclsyntax.TokenOHeredoc {
inHeredoc = true inHeredoc = true
} }
} }
for _, token := range line.assign {
netBrackets += tokenBracketChange(token)
}
switch { switch {
case netBrackets > 0: case netBrackets > 0:

2
vendor/modules.txt vendored
View File

@ -307,7 +307,7 @@ github.com/hashicorp/hcl/hcl/scanner
github.com/hashicorp/hcl/hcl/strconv github.com/hashicorp/hcl/hcl/strconv
github.com/hashicorp/hcl/json/scanner github.com/hashicorp/hcl/json/scanner
github.com/hashicorp/hcl/json/token github.com/hashicorp/hcl/json/token
# github.com/hashicorp/hcl2 v0.0.0-20190226234159-7e26f2f34612 # github.com/hashicorp/hcl2 v0.0.0-20190315201941-956e03eb6dda
github.com/hashicorp/hcl2/hcl github.com/hashicorp/hcl2/hcl
github.com/hashicorp/hcl2/hcl/hclsyntax github.com/hashicorp/hcl2/hcl/hclsyntax
github.com/hashicorp/hcl2/hcldec github.com/hashicorp/hcl2/hcldec