()
| 243 | } |
| 244 | |
| 245 | func (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. |
| 266 | func NewVariable(exprID int64) *Variable { |
no test coverage detected