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

Method GetStartLocation

common/ast/ast.go:377–382  ·  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

375// GetStartLocation calculates the human-readable 1-based line and 0-based column of the first character
376// of the expression node at the id.
377func (s *SourceInfo) GetStartLocation(id int64) common.Location {
378 if o, found := s.GetOffsetRange(id); found {
379 return s.GetLocationByOffset(o.Start)
380 }
381 return common.NoLocation
382}
383
384// GetStopLocation calculates the human-readable 1-based line and 0-based column of the last character for
385// 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