hcl: support "." in identifier
This commit is contained in:
parent
2c88e7ea6e
commit
256bb51ed8
@ -193,7 +193,8 @@ func (x *hclLex) lexId(yylval *hclSymType) int {
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
if !unicode.IsDigit(c) && !unicode.IsLetter(c) && c != '_' && c != '-' {
|
if !unicode.IsDigit(c) && !unicode.IsLetter(c) &&
|
||||||
|
c != '_' && c != '-' && c != '.' {
|
||||||
x.backup()
|
x.backup()
|
||||||
|
|
||||||
if first {
|
if first {
|
||||||
|
@ -20,6 +20,10 @@ func TestLex(t *testing.T) {
|
|||||||
"comment_single.hcl",
|
"comment_single.hcl",
|
||||||
[]int{lexEOF},
|
[]int{lexEOF},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"complex_key.hcl",
|
||||||
|
[]int{IDENTIFIER, EQUAL, STRING, lexEOF},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"multiple.hcl",
|
"multiple.hcl",
|
||||||
[]int{
|
[]int{
|
||||||
|
1
hcl/test-fixtures/complex_key.hcl
Normal file
1
hcl/test-fixtures/complex_key.hcl
Normal file
@ -0,0 +1 @@
|
|||||||
|
foo.bar = "baz"
|
Loading…
Reference in New Issue
Block a user