diff --git a/vendor/github.com/hashicorp/hcl/hcl/scanner/scanner.go b/vendor/github.com/hashicorp/hcl/hcl/scanner/scanner.go index d387794bc..69662367f 100644 --- a/vendor/github.com/hashicorp/hcl/hcl/scanner/scanner.go +++ b/vendor/github.com/hashicorp/hcl/hcl/scanner/scanner.go @@ -480,7 +480,7 @@ func (s *Scanner) scanString() { // read character after quote ch := s.next() - if ch < 0 || ch == eof { + if (ch == '\n' && braces == 0) || ch < 0 || ch == eof { s.err("literal not terminated") return } diff --git a/vendor/github.com/hashicorp/hcl/hcl/strconv/quote.go b/vendor/github.com/hashicorp/hcl/hcl/strconv/quote.go index d5787693f..5f981eaa2 100644 --- a/vendor/github.com/hashicorp/hcl/hcl/strconv/quote.go +++ b/vendor/github.com/hashicorp/hcl/hcl/strconv/quote.go @@ -27,6 +27,9 @@ func Unquote(s string) (t string, err error) { if quote != '"' { return "", ErrSyntax } + if !contains(s, '$') && !contains(s, '{') && contains(s, '\n') { + return "", ErrSyntax + } // Is it trivial? Avoid allocation. if !contains(s, '\\') && !contains(s, quote) && !contains(s, '$') { @@ -84,6 +87,10 @@ func Unquote(s string) (t string, err error) { } } + if s[0] == '\n' { + return "", ErrSyntax + } + c, multibyte, ss, err := unquoteChar(s, quote) if err != nil { return "", err diff --git a/vendor/vendor.json b/vendor/vendor.json index 8497b6d68..3b477889e 100644 --- a/vendor/vendor.json +++ b/vendor/vendor.json @@ -1514,68 +1514,68 @@ { "checksumSHA1": "8OPDk+bKyRGJoKcS4QNw9F7dpE8=", "path": "github.com/hashicorp/hcl", - "revision": "7cb7455c285ca3bf3362aa4ba6a06a6d6f5c3ba0", - "revisionTime": "2016-11-22T02:11:24Z" + "revision": "5550aaba7896ad2a161888b40954bc0f0787bb81", + "revisionTime": "2016-11-29T18:26:28Z" }, { "checksumSHA1": "XQmjDva9JCGGkIecOgwtBEMCJhU=", "path": "github.com/hashicorp/hcl/hcl/ast", - "revision": "7cb7455c285ca3bf3362aa4ba6a06a6d6f5c3ba0", - "revisionTime": "2016-11-22T02:11:24Z" + "revision": "5550aaba7896ad2a161888b40954bc0f0787bb81", + "revisionTime": "2016-11-29T18:26:28Z" }, { "checksumSHA1": "5HVecyfmcTm6OTffEi6LGayQf5M=", "path": "github.com/hashicorp/hcl/hcl/fmtcmd", - "revision": "7cb7455c285ca3bf3362aa4ba6a06a6d6f5c3ba0", - "revisionTime": "2016-11-22T02:11:24Z" + "revision": "5550aaba7896ad2a161888b40954bc0f0787bb81", + "revisionTime": "2016-11-29T18:26:28Z" }, { "checksumSHA1": "croNloscHsjX87X+4/cKOURf1EY=", "path": "github.com/hashicorp/hcl/hcl/parser", - "revision": "7cb7455c285ca3bf3362aa4ba6a06a6d6f5c3ba0", - "revisionTime": "2016-11-22T02:11:24Z" + "revision": "5550aaba7896ad2a161888b40954bc0f0787bb81", + "revisionTime": "2016-11-29T18:26:28Z" }, { "checksumSHA1": "1k1PQRPdYEjeTbXsYz5ZP+Won1w=", "path": "github.com/hashicorp/hcl/hcl/printer", - "revision": "7cb7455c285ca3bf3362aa4ba6a06a6d6f5c3ba0", - "revisionTime": "2016-11-22T02:11:24Z" + "revision": "5550aaba7896ad2a161888b40954bc0f0787bb81", + "revisionTime": "2016-11-29T18:26:28Z" }, { - "checksumSHA1": "Zz4271B4Kc+rwwK7cbaRv7STfO8=", + "checksumSHA1": "z6wdP4mRw4GVjShkNHDaOWkbxS0=", "path": "github.com/hashicorp/hcl/hcl/scanner", - "revision": "7cb7455c285ca3bf3362aa4ba6a06a6d6f5c3ba0", - "revisionTime": "2016-11-22T02:11:24Z" + "revision": "5550aaba7896ad2a161888b40954bc0f0787bb81", + "revisionTime": "2016-11-29T18:26:28Z" }, { - "checksumSHA1": "/e0ULfQnGeUKiM1+iMnQhImo62k=", + "checksumSHA1": "oS3SCN9Wd6D8/LG0Yx1fu84a7gI=", "path": "github.com/hashicorp/hcl/hcl/strconv", - "revision": "7cb7455c285ca3bf3362aa4ba6a06a6d6f5c3ba0", - "revisionTime": "2016-11-22T02:11:24Z" + "revision": "5550aaba7896ad2a161888b40954bc0f0787bb81", + "revisionTime": "2016-11-29T18:26:28Z" }, { "checksumSHA1": "c6yprzj06ASwCo18TtbbNNBHljA=", "path": "github.com/hashicorp/hcl/hcl/token", - "revision": "7cb7455c285ca3bf3362aa4ba6a06a6d6f5c3ba0", - "revisionTime": "2016-11-22T02:11:24Z" + "revision": "5550aaba7896ad2a161888b40954bc0f0787bb81", + "revisionTime": "2016-11-29T18:26:28Z" }, { "checksumSHA1": "138aCV5n8n7tkGYMsMVQQnnLq+0=", "path": "github.com/hashicorp/hcl/json/parser", - "revision": "7cb7455c285ca3bf3362aa4ba6a06a6d6f5c3ba0", - "revisionTime": "2016-11-22T02:11:24Z" + "revision": "5550aaba7896ad2a161888b40954bc0f0787bb81", + "revisionTime": "2016-11-29T18:26:28Z" }, { "checksumSHA1": "YdvFsNOMSWMLnY6fcliWQa0O5Fw=", "path": "github.com/hashicorp/hcl/json/scanner", - "revision": "7cb7455c285ca3bf3362aa4ba6a06a6d6f5c3ba0", - "revisionTime": "2016-11-22T02:11:24Z" + "revision": "5550aaba7896ad2a161888b40954bc0f0787bb81", + "revisionTime": "2016-11-29T18:26:28Z" }, { "checksumSHA1": "fNlXQCQEnb+B3k5UDL/r15xtSJY=", "path": "github.com/hashicorp/hcl/json/token", - "revision": "7cb7455c285ca3bf3362aa4ba6a06a6d6f5c3ba0", - "revisionTime": "2016-11-22T02:11:24Z" + "revision": "5550aaba7896ad2a161888b40954bc0f0787bb81", + "revisionTime": "2016-11-29T18:26:28Z" }, { "checksumSHA1": "/TJCBetWCMVsOpehJzVk3S/xtWM=", diff --git a/website/source/upgrade-guides/0-8.html.markdown b/website/source/upgrade-guides/0-8.html.markdown index 1292e803d..c856718d9 100644 --- a/website/source/upgrade-guides/0-8.html.markdown +++ b/website/source/upgrade-guides/0-8.html.markdown @@ -23,6 +23,40 @@ list of changes will always be the After reviewing this guide, we recommend reviewing the Changelog to check on specific notes about the resources and providers you use. +## Newlines in Strings + +Newlines are no longer allowed in strings unless it is a heredoc or an +interpolation. This improves the performance of IDE syntax highlighting +of Terraform configurations and simplifies parsing. + +**Behavior that no longer works in Terraform 0.8:** + +``` +resource "null_resource" "foo" { + value = "foo +bar" +} +``` + +**Valid Terraform 0.8 configuration:** + +``` +resource "null_resource" "foo" { + value = "foo\nbar" + + value2 = <