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