GetExplanationOutputPolicy returns a copy of the policy, except the output of each match block is replaced by the expression in the explanation field.
()
| 134 | // GetExplanationOutputPolicy returns a copy of the policy, except the output of each match block |
| 135 | // is replaced by the expression in the explanation field. |
| 136 | func (p *Policy) GetExplanationOutputPolicy() *Policy { |
| 137 | ep := Policy{ |
| 138 | name: p.name, |
| 139 | semantic: p.semantic, |
| 140 | info: p.info, |
| 141 | metadata: p.metadata, |
| 142 | source: p.source, |
| 143 | } |
| 144 | if p.rule != nil { |
| 145 | ep.rule = p.rule.getExplanationOutputRule() |
| 146 | } |
| 147 | return &ep |
| 148 | } |
| 149 | |
| 150 | // NewImport creates a new typename import node |
| 151 | func NewImport(exprID int64) *Import { |