hcl: support "." in identifier

This commit is contained in:
Mitchell Hashimoto 2014-12-17 11:39:45 -08:00
parent 2c88e7ea6e
commit 256bb51ed8
3 changed files with 7 additions and 1 deletions

View File

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

View File

@ -20,6 +20,10 @@ func TestLex(t *testing.T) {
"comment_single.hcl",
[]int{lexEOF},
},
{
"complex_key.hcl",
[]int{IDENTIFIER, EQUAL, STRING, lexEOF},
},
{
"multiple.hcl",
[]int{

View File

@ -0,0 +1 @@
foo.bar = "baz"