Fix consul test case

This commit is contained in:
Mitchell Hashimoto 2014-08-08 15:16:42 -07:00
parent 95d9b2e530
commit 61bd5db85c
4 changed files with 7 additions and 3 deletions

View File

@ -451,6 +451,10 @@ func (d *decoder) decodeStruct(name string, raw ast.Node, result reflect.Value)
// Create the field name and decode
fieldName = fmt.Sprintf("%s.%s", name, fieldName)
for _, elem := range elems {
if obj, ok := elem.(ast.ObjectNode); ok {
elem = obj.Elem[0].Value
}
if err := d.decode(fieldName, elem, field); err != nil {
return err
}

View File

@ -130,7 +130,7 @@ block:
| blockId block
{
obj := ast.ObjectNode{
K: $2.Key(),
K: $1,
Elem: []ast.AssignmentNode{$2},
}

View File

@ -455,7 +455,7 @@ hcldefault:
//line parse.y:131
{
obj := ast.ObjectNode{
K: hclS[hclpt-0].aitem.Key(),
K: hclS[hclpt-1].str,
Elem: []ast.AssignmentNode{hclS[hclpt-0].aitem},
}

View File

@ -11,5 +11,5 @@ key "foo/bar/" {
}
key "foo/bar/baz" {
polizy = "deny"
policy = "deny"
}