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

Method getExplanationOutputRule

policy/parser.go:245–263  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

243}
244
245func (r *Rule) getExplanationOutputRule() *Rule {
246 if r == nil {
247 return nil
248 }
249 er := Rule{
250 id: r.id,
251 description: r.description,
252 }
253 er.AddVariables(r.Variables())
254 for _, match := range r.matches {
255 em := Match{
256 condition: match.condition,
257 output: match.explanation,
258 rule: match.rule.getExplanationOutputRule(),
259 }
260 er.matches = append(er.matches, &em)
261 }
262 return &er
263}
264
265// NewVariable creates a variable instance.
266func NewVariable(exprID int64) *Variable {

Callers 1

Calls 2

AddVariablesMethod · 0.95
VariablesMethod · 0.95

Tested by

no test coverage detected