applyContentTransformers runs content through each transformer in order, logging changes, and returns the fully-transformed content.
(content string, transformers []contentTransformer)
| 63 | // applyContentTransformers runs content through each transformer in order, |
| 64 | // logging changes, and returns the fully-transformed content. |
| 65 | func applyContentTransformers(content string, transformers []contentTransformer) string { |
| 66 | for _, t := range transformers { |
| 67 | if transformed := t(content); transformed != content { |
| 68 | expressionExtractionLog.Printf("Transformed expression: %s -> %s", content, transformed) |
| 69 | content = transformed |
| 70 | } |
| 71 | } |
| 72 | return content |
| 73 | } |
| 74 | |
| 75 | // addSubExpressionMappings registers a synthetic ExpressionMapping for every |
| 76 | // qualifying terminal sub-expression inside a compound expression so that the |