From 1f6798c4db1e5454cde5a2b14354609ac0f9803a Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Thu, 14 Jul 2011 20:47:13 -0600 Subject: [PATCH] mktables: remove internal restriction The code punted before under the condition changed. But it is relatively easy to handle it; which is needed by future commits. --- lib/unicore/mktables | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/lib/unicore/mktables b/lib/unicore/mktables index 6234ab4..30867f7 100644 --- a/lib/unicore/mktables +++ b/lib/unicore/mktables @@ -3509,10 +3509,27 @@ sub trace { return main::trace(@_); } # Don't add an exact duplicate, as it isn't really a multiple if ($end >= $r->[$i]->start) { - return if $value eq $r->[$i]->value && $type eq $r->[$i]->type; + my $existing_value = $r->[$i]->value; + my $existing_type = $r->[$i]->type; + return if $value eq $existing_value && $type eq $existing_type; + + # If the multiple value is part of an existing range, we want + # to split up that range, so that only the single code point + # is affected. To do this, we first call ourselves + # recursively to delete that code point from the table, having + # preserved its current data above. Then we call ourselves + # recursively again to add the new multiple, which we know by + # the test just above is different than the current code + # point's value, so it will become a range containing a single + # code point: just itself. Finally, we add back in the + # pre-existing code point, which will again be a single code + # point range. Because 'i' likely will have changed as a + # result of these operations, we can't just continue on, but + # do this operation recursively as well. if ($r->[$i]->start != $r->[$i]->end) { - Carp::my_carp_bug("$owner_name_of{$addr}Can't cope with adding a multiple record when the existing range ($r->[$i]) contains more than one code point. No action taken."); - return; + $self->_add_delete('-', $start, $end, ""); + $self->_add_delete('+', $start, $end, $value, Type => $type); + return $self->_add_delete('+', $start, $end, $existing_value, Type => $existing_type, Replace => $MULTIPLE); } } -- 2.7.4