|
72 | 72 | # the current range, emit the current range and initialize a new
|
73 | 73 | # range representing the gap.
|
74 | 74 | if ($range_end + 1 != $code && $range_category ne $gap_category) {
|
75 |
| - push(@category_ranges, {start => $range_start, end => $range_end, category => $range_category}); |
| 75 | + if ($range_category ne $CATEGORY_UNASSIGNED) { |
| 76 | + push(@category_ranges, {start => $range_start, end => $range_end, |
| 77 | + category => $range_category}); |
| 78 | + } |
76 | 79 | $range_start = $range_end + 1;
|
77 | 80 | $range_end = $code - 1;
|
78 | 81 | $range_category = $gap_category;
|
79 | 82 | }
|
80 | 83 |
|
81 | 84 | # different category; new range
|
82 | 85 | if ($range_category ne $category) {
|
83 |
| - push(@category_ranges, {start => $range_start, end => $range_end, category => $range_category}); |
| 86 | + if ($range_category ne $CATEGORY_UNASSIGNED) { |
| 87 | + push(@category_ranges, {start => $range_start, end => $range_end, |
| 88 | + category => $range_category}); |
| 89 | + } |
84 | 90 | $range_start = $code;
|
85 | 91 | $range_end = $code;
|
86 | 92 | $range_category = $category;
|
|
109 | 115 | if $gap_category ne $CATEGORY_UNASSIGNED;
|
110 | 116 |
|
111 | 117 | # emit final range
|
112 |
| -push(@category_ranges, {start => $range_start, end => $range_end, category => $range_category}); |
113 |
| - |
114 |
| -# emit range for any unassigned code points after last entry |
115 |
| -if ($range_end < 0x10FFFF) { |
116 |
| - $range_start = $range_end + 1; |
117 |
| - $range_end = 0x10FFFF; |
118 |
| - $range_category = $CATEGORY_UNASSIGNED; |
119 |
| - push(@category_ranges, {start => $range_start, end => $range_end, category => $range_category}); |
| 118 | +if ($range_category ne $CATEGORY_UNASSIGNED) { |
| 119 | + push(@category_ranges, {start => $range_start, end => $range_end, |
| 120 | + category => $range_category}); |
120 | 121 | }
|
121 | 122 |
|
122 | 123 | my $num_ranges = scalar @category_ranges;
|
|
0 commit comments