MCPcopy
hub / github.com/hashicorp/hcl / ParseExpressionWithStartPos

Function ParseExpressionWithStartPos

json/public.go:86–89  ·  view source on GitHub ↗

ParseExpressionWithStartPos parses like json.ParseExpression, but unlike json.ParseExpression you can pass a start position of the given JSON expression as a hcl.Pos.

(src []byte, filename string, start hcl.Pos)

Source from the content-addressed store, hash-verified

84// json.ParseExpression you can pass a start position of the given JSON
85// expression as a hcl.Pos.
86func ParseExpressionWithStartPos(src []byte, filename string, start hcl.Pos) (hcl.Expression, hcl.Diagnostics) {
87 node, diags := parseExpression(src, filename, start)
88 return &expression{src: node}, diags
89}
90
91// ParseFile is a convenience wrapper around Parse that first attempts to load
92// data from the given filename, passing the result to Parse if successful.

Callers 2

ParseExpressionFunction · 0.85

Calls 1

parseExpressionFunction · 0.70

Tested by 1