summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2011-01-04 16:50:04 -0700
committerKarl Williamson <public@khwilliamson.com>2011-01-04 17:04:28 -0700
commit56343c7876bb5c64b390f97a6352bd35a04ec558 (patch)
tree79920e221ad4186c972411475ef9c443884d0dcd /lib
parentdfec2a5fbe2529974cb74ca994c8ee364a3756b7 (diff)
downloadperl-56343c7876bb5c64b390f97a6352bd35a04ec558.tar.gz
mktables: Add error check
This makes sure that in certain cases when adding to a table that we know should not have elements in the area that it actually does.
Diffstat (limited to 'lib')
-rw-r--r--lib/unicore/mktables11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/unicore/mktables b/lib/unicore/mktables
index d438d21706..2bf198773f 100644
--- a/lib/unicore/mktables
+++ b/lib/unicore/mktables
@@ -1136,6 +1136,7 @@ my $IF_NOT_EQUIVALENT = 1; # Replace only under certain conditions; details in
my $UNCONDITIONALLY = 2; # Replace without conditions.
my $MULTIPLE = 4; # Don't replace, but add a duplicate record if
# already there
+my $CROAK = 5; # Die with an error if is already there
# Flags to give property statuses. The phrases are to remind maintainers that
# if the flag is changed, the indefinite article referring to it in the
@@ -3523,6 +3524,13 @@ sub trace { return main::trace(@_); }
if ($clean_insert) {
if ($r->[$j]->standard_form ne $standard_form) {
$clean_insert = 0;
+ if ($replace == $CROAK) {
+ main::croak("The range to add "
+ . sprintf("%04X", $start)
+ . '-'
+ . sprintf("%04X", $end)
+ . " with value '$value' overlaps an existing range $r->[$j]");
+ }
}
else {
@@ -10995,7 +11003,8 @@ sub finish_Unicode() {
# Add mappings to the property for each code point in the list
foreach my $range ($list->ranges) {
- $property->add_map($range->start, $range->end, $default);
+ $property->add_map($range->start, $range->end, $default,
+ Replace => $CROAK);
}
}