Merge pull request #7201 from hashicorp/b-update-hcl-jun16

vendor: Update hashicorp/hcl to latest version
This commit is contained in:
James Nugent 2016-06-20 18:15:43 +02:00 committed by GitHub
commit cf39fb22c2
3 changed files with 32 additions and 49 deletions

View File

@ -132,22 +132,13 @@ func TestLoadFileHeredoc(t *testing.T) {
} }
func TestLoadFileEscapedQuotes(t *testing.T) { func TestLoadFileEscapedQuotes(t *testing.T) {
c, err := LoadFile(filepath.Join(fixtureDir, "escapedquotes.tf")) _, err := LoadFile(filepath.Join(fixtureDir, "escapedquotes.tf"))
if err != nil { if err == nil {
t.Fatalf("err: %s", err) t.Fatalf("expected syntax error as escaped quotes are no longer supported")
} }
if c == nil { if !strings.Contains(err.Error(), "syntax error") {
t.Fatal("config should not be nil") t.Fatalf("expected \"syntax error\", got: %s", err)
}
if c.Dir != "" {
t.Fatalf("bad: %#v", c.Dir)
}
actual := resourcesStr(c.Resources)
if actual != strings.TrimSpace(escapedquotesResourcesStr) {
t.Fatalf("bad:\n%s", actual)
} }
} }
@ -787,13 +778,6 @@ aws_instance.test (x1)
inline inline
` `
const escapedquotesResourcesStr = `
aws_instance.quotes (x1)
ami
vars
user: var.ami
`
const basicOutputsStr = ` const basicOutputsStr = `
web_ip web_ip
vars vars

View File

@ -49,8 +49,7 @@ func Unquote(s string) (t string, err error) {
for len(s) > 0 { for len(s) > 0 {
// If we're starting a '${}' then let it through un-unquoted. // If we're starting a '${}' then let it through un-unquoted.
// Specifically: we don't unquote any characters within the `${}` // Specifically: we don't unquote any characters within the `${}`
// section, except for escaped quotes and escaped backslashes, which we // section, except for escaped backslashes, which we handle specifically.
// handle specifically.
if s[0] == '$' && len(s) > 1 && s[1] == '{' { if s[0] == '$' && len(s) > 1 && s[1] == '{' {
buf = append(buf, '$', '{') buf = append(buf, '$', '{')
s = s[2:] s = s[2:]
@ -65,12 +64,12 @@ func Unquote(s string) (t string, err error) {
s = s[size:] s = s[size:]
// We special case escaped double quotes and escaped backslashes in // We special case escaped backslashes in interpolations, converting
// interpolations, converting them to their unescaped equivalents. // them to their unescaped equivalents.
if r == '\\' { if r == '\\' {
q, _ := utf8.DecodeRuneInString(s) q, _ := utf8.DecodeRuneInString(s)
switch q { switch q {
case '"', '\\': case '\\':
continue continue
} }
} }

46
vendor/vendor.json vendored
View File

@ -772,68 +772,68 @@
{ {
"checksumSHA1": "5LrCq/ydlbL6pq1cdmuxiw7QV98=", "checksumSHA1": "5LrCq/ydlbL6pq1cdmuxiw7QV98=",
"path": "github.com/hashicorp/hcl", "path": "github.com/hashicorp/hcl",
"revision": "d7400db7143f8e869812e50a53acd6c8d92af3b8", "revision": "aa7699b7b62c5f410f4cf7b58f3f9b17a71fb4ad",
"revisionTime": "2016-06-07T00:19:40Z" "revisionTime": "2016-06-16T21:00:17Z"
}, },
{ {
"checksumSHA1": "WP5ODRo9+USuAsKYPu5RW3q8Epg=", "checksumSHA1": "WP5ODRo9+USuAsKYPu5RW3q8Epg=",
"path": "github.com/hashicorp/hcl/hcl/ast", "path": "github.com/hashicorp/hcl/hcl/ast",
"revision": "d7400db7143f8e869812e50a53acd6c8d92af3b8", "revision": "aa7699b7b62c5f410f4cf7b58f3f9b17a71fb4ad",
"revisionTime": "2016-06-07T00:19:40Z" "revisionTime": "2016-06-16T21:00:17Z"
}, },
{ {
"checksumSHA1": "z03dif8bqgQ3Zk/1RGbvfgBXMXo=", "checksumSHA1": "z03dif8bqgQ3Zk/1RGbvfgBXMXo=",
"path": "github.com/hashicorp/hcl/hcl/fmtcmd", "path": "github.com/hashicorp/hcl/hcl/fmtcmd",
"revision": "d7400db7143f8e869812e50a53acd6c8d92af3b8", "revision": "aa7699b7b62c5f410f4cf7b58f3f9b17a71fb4ad",
"revisionTime": "2016-06-07T00:19:40Z" "revisionTime": "2016-06-16T21:00:17Z"
}, },
{ {
"checksumSHA1": "SVw0qm83Anf5T2GkYabn+f7Ibv0=", "checksumSHA1": "SVw0qm83Anf5T2GkYabn+f7Ibv0=",
"path": "github.com/hashicorp/hcl/hcl/parser", "path": "github.com/hashicorp/hcl/hcl/parser",
"revision": "d7400db7143f8e869812e50a53acd6c8d92af3b8", "revision": "aa7699b7b62c5f410f4cf7b58f3f9b17a71fb4ad",
"revisionTime": "2016-06-07T00:19:40Z" "revisionTime": "2016-06-16T21:00:17Z"
}, },
{ {
"checksumSHA1": "CSmwxPOTz7GSpnWPF9aGkbVeR64=", "checksumSHA1": "CSmwxPOTz7GSpnWPF9aGkbVeR64=",
"path": "github.com/hashicorp/hcl/hcl/printer", "path": "github.com/hashicorp/hcl/hcl/printer",
"revision": "d7400db7143f8e869812e50a53acd6c8d92af3b8", "revision": "aa7699b7b62c5f410f4cf7b58f3f9b17a71fb4ad",
"revisionTime": "2016-06-07T00:19:40Z" "revisionTime": "2016-06-16T21:00:17Z"
}, },
{ {
"checksumSHA1": "WZM0q7Sya8PcGj607x1npgcEPa4=", "checksumSHA1": "WZM0q7Sya8PcGj607x1npgcEPa4=",
"path": "github.com/hashicorp/hcl/hcl/scanner", "path": "github.com/hashicorp/hcl/hcl/scanner",
"revision": "d7400db7143f8e869812e50a53acd6c8d92af3b8", "revision": "aa7699b7b62c5f410f4cf7b58f3f9b17a71fb4ad",
"revisionTime": "2016-06-07T00:19:40Z" "revisionTime": "2016-06-16T21:00:17Z"
}, },
{ {
"checksumSHA1": "ETy6J7OZ7zjBNq0V0Lm8E/7Xafw=", "checksumSHA1": "riN5acfVDm4j6LhWXauqiWH5n84=",
"path": "github.com/hashicorp/hcl/hcl/strconv", "path": "github.com/hashicorp/hcl/hcl/strconv",
"revision": "d7400db7143f8e869812e50a53acd6c8d92af3b8", "revision": "aa7699b7b62c5f410f4cf7b58f3f9b17a71fb4ad",
"revisionTime": "2016-06-07T00:19:40Z" "revisionTime": "2016-06-16T21:00:17Z"
}, },
{ {
"checksumSHA1": "VGNVyGYDGTTCTRqGH5R+CL0u6xw=", "checksumSHA1": "VGNVyGYDGTTCTRqGH5R+CL0u6xw=",
"path": "github.com/hashicorp/hcl/hcl/token", "path": "github.com/hashicorp/hcl/hcl/token",
"revision": "d7400db7143f8e869812e50a53acd6c8d92af3b8", "revision": "aa7699b7b62c5f410f4cf7b58f3f9b17a71fb4ad",
"revisionTime": "2016-06-07T00:19:40Z" "revisionTime": "2016-06-16T21:00:17Z"
}, },
{ {
"checksumSHA1": "uEaK2zagnGctsUmjWt8ZYmK1Yvs=", "checksumSHA1": "uEaK2zagnGctsUmjWt8ZYmK1Yvs=",
"path": "github.com/hashicorp/hcl/json/parser", "path": "github.com/hashicorp/hcl/json/parser",
"revision": "d7400db7143f8e869812e50a53acd6c8d92af3b8", "revision": "aa7699b7b62c5f410f4cf7b58f3f9b17a71fb4ad",
"revisionTime": "2016-06-07T00:19:40Z" "revisionTime": "2016-06-16T21:00:17Z"
}, },
{ {
"checksumSHA1": "S1e0F9ZKSnqgOLfjDTYazRL28tA=", "checksumSHA1": "S1e0F9ZKSnqgOLfjDTYazRL28tA=",
"path": "github.com/hashicorp/hcl/json/scanner", "path": "github.com/hashicorp/hcl/json/scanner",
"revision": "d7400db7143f8e869812e50a53acd6c8d92af3b8", "revision": "aa7699b7b62c5f410f4cf7b58f3f9b17a71fb4ad",
"revisionTime": "2016-06-07T00:19:40Z" "revisionTime": "2016-06-16T21:00:17Z"
}, },
{ {
"checksumSHA1": "fNlXQCQEnb+B3k5UDL/r15xtSJY=", "checksumSHA1": "fNlXQCQEnb+B3k5UDL/r15xtSJY=",
"path": "github.com/hashicorp/hcl/json/token", "path": "github.com/hashicorp/hcl/json/token",
"revision": "d7400db7143f8e869812e50a53acd6c8d92af3b8", "revision": "aa7699b7b62c5f410f4cf7b58f3f9b17a71fb4ad",
"revisionTime": "2016-06-07T00:19:40Z" "revisionTime": "2016-06-16T21:00:17Z"
}, },
{ {
"checksumSHA1": "vWW3HXm7OTOMISuZPcCSJODRYkU=", "checksumSHA1": "vWW3HXm7OTOMISuZPcCSJODRYkU=",