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

Method getExplanationOutputRule

policy/parser.go:286–305  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

284}
285
286func (r *Rule) getExplanationOutputRule() *Rule {
287 if r == nil {
288 return nil
289 }
290 er := Rule{
291 id: r.id,
292 description: r.description,
293 semantic: r.semantic,
294 }
295 er.AddVariables(r.Variables())
296 for _, match := range r.matches {
297 em := Match{
298 condition: match.condition,
299 output: match.explanation,
300 rule: match.rule.getExplanationOutputRule(),
301 }
302 er.matches = append(er.matches, &em)
303 }
304 return &er
305}
306
307// NewVariable creates a variable instance.
308func NewVariable(exprID int64) *Variable {

Callers 1

Calls 2

AddVariablesMethod · 0.95
VariablesMethod · 0.95

Tested by

no test coverage detected