replace parse with new json parser

This commit is contained in:
Mitchell Hashimoto 2015-11-08 15:53:33 -08:00
parent cf0da81e50
commit b3a9867999

View File

@ -5,7 +5,7 @@ import (
"github.com/hashicorp/hcl/hcl/ast"
hclParser "github.com/hashicorp/hcl/hcl/parser"
"github.com/hashicorp/hcl/json"
jsonParser "github.com/hashicorp/hcl/json/parser"
)
// Parse parses the given input and returns the root object.
@ -16,7 +16,7 @@ func Parse(input string) (*ast.File, error) {
case lexModeHcl:
return hclParser.Parse([]byte(input))
case lexModeJson:
return json.Parse(input)
return jsonParser.Parse([]byte(input))
}
return nil, fmt.Errorf("unknown config format")