()
| 284 | } |
| 285 | |
| 286 | func (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. |
| 308 | func NewVariable(exprID int64) *Variable { |
no test coverage detected