Record each offset passed to the processor's compiled expression.
| 778 | |
| 779 | |
| 780 | class _InlineProcessorThatRecordsSearchIndex(inlinepatterns.InlineProcessor): |
| 781 | """Record each offset passed to the processor's compiled expression.""" |
| 782 | |
| 783 | def __init__(self, pattern, md): |
| 784 | super().__init__(pattern, md) |
| 785 | self.start_indices = [] |
| 786 | |
| 787 | def getCompiledRegExp(self): |
| 788 | return _RecordingPattern(self.compiled_re, self.start_indices) |
| 789 | |
| 790 | def handleMatch(self, m, data): |
| 791 | return m.group(0), m.start(0), m.end(0) |
| 792 | |
| 793 | |
| 794 | class TestConfigParsing(unittest.TestCase): |
no outgoing calls