hcl/parser: parse heredocs

This commit is contained in:
Mitchell Hashimoto 2015-11-10 14:03:29 -08:00
parent 6c34ace97d
commit 0f965478b6
2 changed files with 2 additions and 1 deletions

View File

@ -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()

View File

@ -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 {