diff --git a/hcl/parser/parser.go b/hcl/parser/parser.go index 9969daa4..dbff3904 100644 --- a/hcl/parser/parser.go +++ b/hcl/parser/parser.go @@ -264,7 +264,7 @@ func (p *Parser) listType() (*ast.ListType, error) { for { tok := p.scan() switch tok.Type { - case token.NUMBER, token.FLOAT, token.STRING: + case token.NUMBER, token.FLOAT, token.STRING, token.HEREDOC: if needComma { return nil, &PosError{ Pos: tok.Pos, diff --git a/hcl/parser/parser_test.go b/hcl/parser/parser_test.go index cda68cc4..61adeb94 100644 --- a/hcl/parser/parser_test.go +++ b/hcl/parser/parser_test.go @@ -64,6 +64,15 @@ func TestListType(t *testing.T) { `foo = ["123", 123]`, []token.Type{token.STRING, token.NUMBER}, }, + { + `foo = [1, +"string", +<