This repository has been archived by the owner on Oct 3, 2019. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
hclsyntax: emit Newline after a CHeredoc
Previously, due to how heredoc scanning was implemented, the closing marker for a heredoc would consume the newline that terminated it. This was problematic in any context that is newline-sensitive, because it would cause us to skip the TokenNewline that might terminate e.g. an attribute definition: foo = <<EOT hello EOT bar = "hello" Previously the "foo" attribute would fail to parse properly due to trying to consume the "bar" definition as part of its expression. Now we synthetically split the marker token into two parts: the marker itself and the newline that follows it. This means that using a heredoc in any context where newlines are sensitive will involuntarily introduce a newline, but that seems consistent with user expectation based on how heredocs seem to be used "in the wild".
- Loading branch information