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

Method relSource

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

Source from the content-addressed store, hash-verified

469}
470
471func (c *compiler) relSource(pstr ValueString) *RelativeSource {
472 line := 0
473 col := 1
474 if offset, found := c.info.GetOffsetRange(pstr.ID); found {
475 if loc, found := c.src.OffsetLocation(offset.Start); found {
476 line = loc.Line()
477 col = loc.Column()
478 }
479 }
480 return c.src.Relative(pstr.Value, line, col)
481}
482
483const (
484 // 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