hcl/parser: parse heredocs
This commit is contained in:
parent
6c34ace97d
commit
0f965478b6
@ -202,7 +202,7 @@ func (p *Parser) object() (ast.Node, error) {
|
||||
tok := p.scan()
|
||||
|
||||
switch tok.Type {
|
||||
case token.NUMBER, token.FLOAT, token.BOOL, token.STRING:
|
||||
case token.NUMBER, token.FLOAT, token.BOOL, token.STRING, token.HEREDOC:
|
||||
return p.literalType()
|
||||
case token.LBRACE:
|
||||
return p.objectType()
|
||||
|
@ -22,6 +22,7 @@ func TestType(t *testing.T) {
|
||||
{token.FLOAT, `foo = 123.12`},
|
||||
{token.FLOAT, `foo = -123.12`},
|
||||
{token.BOOL, `foo = true`},
|
||||
{token.HEREDOC, "foo = <<EOF\nHello\nWorld\nEOF"},
|
||||
}
|
||||
|
||||
for _, l := range literals {
|
||||
|
Loading…
Reference in New Issue
Block a user