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

Method relSource

policy/compiler.go:494–504  ·  view source on GitHub ↗
(pstr ValueString)

Source from the content-addressed store, hash-verified

492}
493
494func (c *compiler) relSource(pstr ValueString) *RelativeSource {
495 line := 0
496 col := 1
497 if offset, found := c.info.GetOffsetRange(pstr.ID); found {
498 if loc, found := c.src.OffsetLocation(offset.Start); found {
499 line = loc.Line()
500 col = loc.Column()
501 }
502 }
503 return c.src.Relative(pstr.Value, line, col)
504}
505
506const (
507 // Consider making the variables namespace configurable.

Callers 2

compileRuleMethod · 0.95
RelSourceMethod · 0.80

Calls 5

GetOffsetRangeMethod · 0.80
RelativeMethod · 0.80
OffsetLocationMethod · 0.65
LineMethod · 0.65
ColumnMethod · 0.65

Tested by

no test coverage detected