Merge pull request #65 from hashicorp/b-map-identifiers
Fix scanning of identifiers of the form 'map.key'
This commit is contained in:
commit
692d016087
@ -43,6 +43,15 @@ func TestDecode_interface(t *testing.T) {
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"tfvars.hcl",
|
||||
false,
|
||||
map[string]interface{}{
|
||||
"regularvar": "Should work",
|
||||
"map.key1": "Value",
|
||||
"map.key2": "Other value",
|
||||
},
|
||||
},
|
||||
{
|
||||
"escape.hcl",
|
||||
false,
|
||||
|
@ -516,7 +516,7 @@ func (s *Scanner) scanDigits(ch rune, base, n int) rune {
|
||||
func (s *Scanner) scanIdentifier() string {
|
||||
offs := s.srcPos.Offset - s.lastCharLen
|
||||
ch := s.next()
|
||||
for isLetter(ch) || isDigit(ch) || ch == '-' {
|
||||
for isLetter(ch) || isDigit(ch) || ch == '-' || ch == '.' {
|
||||
ch = s.next()
|
||||
}
|
||||
|
||||
|
3
test-fixtures/tfvars.hcl
Normal file
3
test-fixtures/tfvars.hcl
Normal file
@ -0,0 +1,3 @@
|
||||
regularvar = "Should work"
|
||||
map.key1 = "Value"
|
||||
map.key2 = "Other value"
|
Loading…
Reference in New Issue
Block a user