(pred)
| 18 | |
| 19 | |
| 20 | def ranges(pred): |
| 21 | out = [] |
| 22 | start = None |
| 23 | for c in range(MAXCP): |
| 24 | ok = not is_surrogate(c) and pred(chr(c)) |
| 25 | if ok and start is None: |
| 26 | start = c |
| 27 | elif not ok and start is not None: |
| 28 | out.append((start, c - 1)) |
| 29 | start = None |
| 30 | if start is not None: |
| 31 | out.append((start, MAXCP - 1)) |
| 32 | return out |
| 33 | |
| 34 | |
| 35 | def emit_ranges(f, name, rs): |
no test coverage detected