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

Method GetOffsetRange

common/ast/ast.go:352–358  ·  view source on GitHub ↗

GetOffsetRange retrieves an OffsetRange for the given expression id if one exists.

(id int64)

Source from the content-addressed store, hash-verified

350
351// GetOffsetRange retrieves an OffsetRange for the given expression id if one exists.
352func (s *SourceInfo) GetOffsetRange(id int64) (OffsetRange, bool) {
353 if s == nil {
354 return OffsetRange{}, false
355 }
356 o, found := s.offsetRanges[id]
357 return o, found
358}
359
360// SetOffsetRange sets the OffsetRange for the given expression id.
361func (s *SourceInfo) SetOffsetRange(id int64, o OffsetRange) {

Callers 10

GetStartLocationMethod · 0.95
GetStopLocationMethod · 0.95
VisitExprMethod · 0.80
VisitExprMethod · 0.80
exprLinesFromPolicyFunction · 0.80
relSourceMethod · 0.80
CopyMethod · 0.80
TestParseFunction · 0.80
TestSourceInfoNilSafetyFunction · 0.80

Calls

no outgoing calls

Tested by 6

VisitExprMethod · 0.64
VisitExprMethod · 0.64
exprLinesFromPolicyFunction · 0.64
TestParseFunction · 0.64
TestSourceInfoNilSafetyFunction · 0.64