MCPcopy Create free account
hub / github.com/cel-expr/cel-go / GetStartLocation

Method GetStartLocation

common/ast/ast.go:385–390  ·  view source on GitHub ↗

GetStartLocation calculates the human-readable 1-based line and 0-based column of the first character of the expression node at the id.

(id int64)

Source from the content-addressed store, hash-verified

383// GetStartLocation calculates the human-readable 1-based line and 0-based column of the first character
384// of the expression node at the id.
385func (s *SourceInfo) GetStartLocation(id int64) common.Location {
386 if o, found := s.GetOffsetRange(id); found {
387 return s.GetLocationByOffset(o.Start)
388 }
389 return common.NoLocation
390}
391
392// GetStopLocation calculates the human-readable 1-based line and 0-based column of the last character for
393// the expression node at the given id.

Callers 7

TestSourceInfoFunction · 0.95
locationByIDMethod · 0.80
getLocationMethod · 0.80
OffsetLocationMethod · 0.80
GetLocationMethod · 0.80
ReportErrorAtIDMethod · 0.80
TestSourceInfoNilSafetyFunction · 0.80

Calls 2

GetOffsetRangeMethod · 0.95
GetLocationByOffsetMethod · 0.95

Tested by 3

TestSourceInfoFunction · 0.76
GetLocationMethod · 0.64
TestSourceInfoNilSafetyFunction · 0.64