hcl: identifiers can have '-'

This commit is contained in:
Mitchell Hashimoto 2014-08-28 17:03:42 -07:00
parent 71e25b33f0
commit a0a5d2873e
3 changed files with 5 additions and 3 deletions

View File

@ -25,8 +25,9 @@ func TestDecode_interface(t *testing.T) {
"basic_squish.hcl",
false,
map[string]interface{}{
"foo": "bar",
"bar": "${file(\"bing/bong.txt\")}",
"foo": "bar",
"bar": "${file(\"bing/bong.txt\")}",
"foo-bar": "baz",
},
},
{

View File

@ -170,7 +170,7 @@ func (x *hclLex) lexId(yylval *hclSymType) int {
break
}
if !unicode.IsDigit(c) && !unicode.IsLetter(c) && c != '_' {
if !unicode.IsDigit(c) && !unicode.IsLetter(c) && c != '_' && c != '-' {
x.backup()
break
}

View File

@ -1,2 +1,3 @@
foo="bar"
bar="${file("bing/bong.txt")}"
foo-bar="baz"