aboutsummaryrefslogtreecommitdiff
path: root/vendor/github.com/hashicorp/hcl/json
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/hashicorp/hcl/json')
-rw-r--r--vendor/github.com/hashicorp/hcl/json/parser/flatten.go6
-rw-r--r--vendor/github.com/hashicorp/hcl/json/parser/parser.go1
2 files changed, 7 insertions, 0 deletions
diff --git a/vendor/github.com/hashicorp/hcl/json/parser/flatten.go b/vendor/github.com/hashicorp/hcl/json/parser/flatten.go
index 6eb14a2..f652d6f 100644
--- a/vendor/github.com/hashicorp/hcl/json/parser/flatten.go
+++ b/vendor/github.com/hashicorp/hcl/json/parser/flatten.go
@@ -48,6 +48,12 @@ func flattenListType(
item *ast.ObjectItem,
items []*ast.ObjectItem,
frontier []*ast.ObjectItem) ([]*ast.ObjectItem, []*ast.ObjectItem) {
+ // If the list is empty, keep the original list
+ if len(ot.List) == 0 {
+ items = append(items, item)
+ return items, frontier
+ }
+
// All the elements of this object must also be objects!
for _, subitem := range ot.List {
if _, ok := subitem.(*ast.ObjectType); !ok {
diff --git a/vendor/github.com/hashicorp/hcl/json/parser/parser.go b/vendor/github.com/hashicorp/hcl/json/parser/parser.go
index acf9594..6f46085 100644
--- a/vendor/github.com/hashicorp/hcl/json/parser/parser.go
+++ b/vendor/github.com/hashicorp/hcl/json/parser/parser.go
@@ -86,6 +86,7 @@ func (p *Parser) objectList() (*ast.ObjectList, error) {
break
}
}
+
return node, nil
}