hcl/test-fixtures/multiline_no_hanging_indent.hcl
James Nugent f5480db646 Remove hanging indent on HEREDOCs with <<- prefix
This commit adds support for removing a hanging indent from HEREDOC
token contents if the marker is prefixed with <<-. For example, given
the HCL definition:

my_long_var_name = <<-EOF
                   {
                       "key": "value"
                   }
                   EOF

The value of the HEREDOC will be:

{
    "key": "value"
}

This is useful for use cases where indentation or leading whitespace
is important.

The rule applied is that the prefix on the terminating marker will be
removed from each each line in the HEREDOC, providing all the lines have
that prefix (i.e. every line is at least as indented as the terminating
marker, and using the same mechanism of tabs vs spaces).
2016-03-21 14:12:20 +00:00

6 lines
47 B
HCL