Parses ranges of code points, as described in UAX #44: https://www.unicode.org/reports/tr44/#Code_Point_Ranges
(char_range: str)
| 922 | |
| 923 | |
| 924 | def expand_range(char_range: str) -> Iterator[int]: |
| 925 | ''' |
| 926 | Parses ranges of code points, as described in UAX #44: |
| 927 | https://www.unicode.org/reports/tr44/#Code_Point_Ranges |
| 928 | ''' |
| 929 | if '..' in char_range: |
| 930 | first, last = [int(c, 16) for c in char_range.split('..')] |
| 931 | else: |
| 932 | first = last = int(char_range, 16) |
| 933 | for char in range(first, last+1): |
| 934 | yield char |
| 935 | |
| 936 | |
| 937 | class UcdFile: |