diff options
author | Karl Williamson <khw@cpan.org> | 2021-12-11 13:32:49 -0700 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2021-12-13 15:41:57 -0700 |
commit | 812ea1980cc75f8ec5d7942ca228dce43bca2d26 (patch) | |
tree | a1ffd6ce45a7ac7d3cb0ceb744b01db36e5a739c | |
parent | abcd2798a3caca6295c39865e33d0927b983292a (diff) | |
download | perl-812ea1980cc75f8ec5d7942ca228dce43bca2d26.tar.gz |
mktables: Use builtin::refaddr
Now that this function is available in miniperl, mktables can use it to
avoid a bunch of visually distracting 'no overloading' calls.
-rw-r--r-- | charclass_invlists.h | 2 | ||||
-rw-r--r-- | lib/unicore/mktables | 221 | ||||
-rw-r--r-- | lib/unicore/uni_keywords.pl | 2 | ||||
-rw-r--r-- | regcharclass.h | 2 | ||||
-rw-r--r-- | uni_keywords.h | 2 |
5 files changed, 100 insertions, 129 deletions
diff --git a/charclass_invlists.h b/charclass_invlists.h index 98c8e402d5..0f3c91aa5b 100644 --- a/charclass_invlists.h +++ b/charclass_invlists.h @@ -430828,7 +430828,7 @@ static const U8 WB_table[23][23] = { * 43f6df50e4878f501b417e366b0ee097ae5ccb2d4ce942026bed3d62d78e7887 lib/unicore/extracted/DLineBreak.txt * a04502ebb36a45d83cbe48a7d8132ea8143edb7b3d34d0aa6afe4a9685049741 lib/unicore/extracted/DNumType.txt * 11075771b112e8e7ccf6ffa637c4c91eadc3ef3db0517b24e605df8fd3624239 lib/unicore/extracted/DNumValues.txt - * bbe28a1f209e4a9f6172673b5109f13d00819c7d749068c7dc89459517f61830 lib/unicore/mktables + * 8b1c80fb062345cd9c4febce79fc06d92e1bf642d83d404dc702acd293f13845 lib/unicore/mktables * c72bbdeda99714db1c8024d3311da4aef3c0db3b9b9f11455a7cfe10d5e9aba3 lib/unicore/version * 0a6b5ab33bb1026531f816efe81aea1a8ffcd34a27cbea37dd6a70a63d73c844 regen/charset_translations.pl * 5f8520d3a17ade6317fc0c423f5091470924b1ef425bca0c41ce8e4a9f8460fe regen/mk_PL_charclass.pl diff --git a/lib/unicore/mktables b/lib/unicore/mktables index 1ba9d41dba..dbb3b0a828 100644 --- a/lib/unicore/mktables +++ b/lib/unicore/mktables @@ -22,6 +22,7 @@ BEGIN { # Get the time the script started running; do it at compilation to require 5.010_001; use strict; use warnings; +use builtin qw(refaddr); use Carp; use Config; use File::Find; @@ -1494,10 +1495,7 @@ sub objaddr($addr) { # every call, and the program is structured so that this is never called # for a non-blessed object. - no overloading; # If overloaded, numifying below won't work. - - # Numifying a ref gives its address. - return pack 'J', $addr; + return pack 'J', refaddr $addr; } # These are used only if $annotate is true. @@ -1858,7 +1856,7 @@ package main; # Use typeglob to give the anonymous subroutine the name we want *$destroy_name = sub { my $self = shift; - my $addr = do { no overloading; pack 'J', $self; }; + my $addr = pack 'J', refaddr $self; $self->$destroy_callback if $destroy_callback; foreach my $field (keys %{$package_fields{$package}}) { @@ -1954,7 +1952,7 @@ package main; # determine using 'eq' for scalars and '==' otherwise. *$subname = sub ($self, $value) { use strict "refs"; - my $addr = do { no overloading; pack 'J', $self; }; + my $addr = pack 'J', refaddr $self; if (ref $value) { return if grep { $value == $_ } @{$field->{$addr}}; } @@ -1986,7 +1984,7 @@ package main; no strict "refs"; *$subname = sub ($_addr) { use strict "refs"; - my $addr = do { no overloading; pack 'J', $_addr; }; + my $addr = pack 'J', refaddr $_addr; if (ref $field->{$addr} ne 'ARRAY') { my $type = ref $field->{$addr}; $type = 'scalar' unless $type; @@ -2007,8 +2005,7 @@ package main; no strict "refs"; *$subname = sub ($addr) { use strict "refs"; - no overloading; - return $field->{pack 'J', $addr}; + return $field->{pack 'J', refaddr $addr}; } } } @@ -2018,8 +2015,7 @@ package main; *$subname = sub ($self, $value) { use strict "refs"; # $self is $_[0]; $value is $_[1] - no overloading; - $field->{pack 'J', $self} = $value; + $field->{pack 'J', refaddr $self} = $value; return; } } @@ -2324,7 +2320,7 @@ sub trace { return main::trace(@_); } my $class = shift; my $self = bless \do{ my $anonymous_scalar }, $class; - my $addr = do { no overloading; pack 'J', $self; }; + my $addr = pack 'J', refaddr $self; # Set defaults $handler{$addr} = \&main::process_generic_property_file; @@ -2652,7 +2648,7 @@ END # flag to make sure extracted files are processed early state $seen_non_extracted = 0; - my $addr = do { no overloading; pack 'J', $self; }; + my $addr = pack 'J', refaddr $self; my $file = $file{$addr}; @@ -2899,7 +2895,7 @@ END # been added via insert_lines() will be returned in $_ before the file # is read again. - my $addr = do { no overloading; pack 'J', $self; }; + my $addr = pack 'J', refaddr $self; # Here the file is open (or if the handle is not a ref, is an open # 'virtual' file). Get the next line; any inserted lines get priority @@ -3080,7 +3076,7 @@ END # insertion code will sort and coalesce the individual code points # into appropriate ranges.) - my $addr = do { no overloading; pack 'J', $self; }; + my $addr = pack 'J', refaddr $self; while (1) { @@ -3155,7 +3151,7 @@ END # # an each_line_handler() on the line. # # my $self = shift; -# my $addr = do { no overloading; pack 'J', $self; }; +# my $addr = pack 'J', refaddr $self; # # foreach my $inserted_ref (@{$added_lines{$addr}}) { # my ($adjusted, $line) = @{$inserted_ref}; @@ -3194,8 +3190,7 @@ END # Each inserted line is an array, with the first element being 0 to # indicate that this line hasn't been adjusted, and needs to be # processed. - no overloading; - push @{$added_lines{pack 'J', $self}}, map { [ 0, $_ ] } @lines; + push @{$added_lines{pack 'J', refaddr $self}}, map { [ 0, $_ ] } @lines; return; } @@ -3217,8 +3212,7 @@ END # Each inserted line is an array, with the first element being 1 to # indicate that this line has been adjusted - no overloading; - push @{$added_lines{pack 'J', $self}}, map { [ 1, $_ ] } @lines; + push @{$added_lines{pack 'J', refaddr $self}}, map { [ 1, $_ ] } @lines; return; } @@ -3228,7 +3222,7 @@ END # element, and the property in the 2nd. However, since these lines # can be stacked up, the return is an array of all these arrays. - my $addr = do { no overloading; pack 'J', $self; }; + my $addr = pack 'J', refaddr $self; # If not accepting a list return, just return the first one. return shift @{$missings{$addr}} unless wantarray; @@ -3300,7 +3294,7 @@ END # Hangul syllables in this release only are something else, so if # using such data, we have to override it - my $addr = do { no overloading; pack 'J', $self; }; + my $addr = pack 'J', refaddr $self; my $object = main::property_ref($property{$addr}); $object->add_map($FIRST_REMOVED_HANGUL_SYLLABLE, @@ -3312,9 +3306,7 @@ END sub _insert_property_into_line($self) { # Add a property field to $_, if this file requires it. - my $addr = do { no overloading; pack 'J', $self; }; - my $property = $property{$addr}; - + my $property = $property{pack 'J', refaddr $self}; $_ =~ s/(;|$)/; $property$1/; return; } @@ -3326,7 +3318,7 @@ END # only outputs the first instance of each message, incrementing a # count so the totals can be output at the end of the file. - my $addr = do { no overloading; pack 'J', $self; }; + my $addr = pack 'J', refaddr $self; $message = 'Unexpected line' unless $message; @@ -3398,7 +3390,7 @@ no warnings 'experimental::signatures'; my $class = shift; my $self = bless \do{my $anonymous_scalar}, $class; - my $addr = do { no overloading; pack 'J', $self; }; + my $addr = pack 'J', refaddr $self; while (@_ > 1) { my $default = shift; @@ -3414,9 +3406,7 @@ no warnings 'experimental::signatures'; sub get_next_defaults($self) { # Iterates and returns the next class of defaults. - my $addr = do { no overloading; pack 'J', $self; }; - - return each %{$class_defaults{$addr}}; + return each %{$class_defaults{pack 'J', refaddr $self}}; } } @@ -3469,7 +3459,7 @@ no warnings 'experimental::signatures'; my $class = shift; my $self = bless \do { my $anonymous_scalar }, $class; - my $addr = do { no overloading; pack 'J', $self; }; + my $addr = pack 'J', refaddr $self; $name{$addr} = shift; $loose_match{$addr} = shift; @@ -3535,7 +3525,7 @@ sub trace { return main::trace(@_); } sub new($class, $_addr, $_end, @_args) { my $self = bless \do { my $anonymous_scalar }, $class; - my $addr = do { no overloading; pack 'J', $self; }; + my $addr = pack 'J', refaddr $self; $start{$addr} = $_addr; $end{$addr} = $_end; @@ -3561,7 +3551,7 @@ sub trace { return main::trace(@_); } ; sub _operator_stringify($self, $other="", $reversed=0) { - my $addr = do { no overloading; pack 'J', $self; }; + my $addr = pack 'J', refaddr $self; # Output it like '0041..0065 (value)' my $return = sprintf("%04X", $start{$addr}) @@ -3584,7 +3574,7 @@ sub trace { return main::trace(@_); } # of writing there are 368676 non-special objects, but the standard # form is only requested for 22047 of them - ie about 6%. - my $addr = do { no overloading; pack 'J', $self; }; + my $addr = pack 'J', refaddr $self; return $standard_form{$addr} if defined $standard_form{$addr}; @@ -3596,7 +3586,7 @@ sub trace { return main::trace(@_); } sub dump($self, $indent) { # Human, not machine readable. For machine readable, comment out this # entire routine and let the standard one take effect. - my $addr = do { no overloading; pack 'J', $self; }; + my $addr = pack 'J', refaddr $self; my $return = $indent . sprintf("%04X", $start{$addr}) @@ -3688,7 +3678,7 @@ sub trace { return main::trace(@_); } return _union($class, $initialize, %args) if defined $initialize; $self = bless \do { my $anonymous_scalar }, $class; - my $addr = do { no overloading; pack 'J', $self; }; + my $addr = pack 'J', refaddr $self; # Optional parent object, only for debug info. $owner_name_of{$addr} = delete $args{'Owner'}; @@ -3718,7 +3708,7 @@ sub trace { return main::trace(@_); } ; sub _operator_stringify($self, $other="", $reversed=0) { - my $addr = do { no overloading; pack 'J', $self; }; + my $addr = pack 'J', refaddr $self; return "Range_List attached to '$owner_name_of{$addr}'" if $owner_name_of{$addr}; @@ -3783,8 +3773,7 @@ sub trace { return main::trace(@_); } if (! defined $arg) { my $message = ""; if (defined $self) { - no overloading; - $message .= $owner_name_of{pack 'J', $self}; + $message .= $owner_name_of{pack 'J', refaddr $self}; } Carp::my_carp_bug($message . "Undefined argument to _union. No union done."); return; @@ -3809,8 +3798,7 @@ sub trace { return main::trace(@_); } else { my $message = ""; if (defined $self) { - no overloading; - $message .= $owner_name_of{pack 'J', $self}; + $message .= $owner_name_of{pack 'J', refaddr $self}; } Carp::my_carp_bug($message . "Cannot take the union of a $type. No union done."); return; @@ -3857,8 +3845,7 @@ sub trace { return main::trace(@_); } } sub range_count($self) { # Return the number of ranges in the range list - no overloading; - return scalar @{$ranges{pack 'J', $self}}; + return scalar @{$ranges{pack 'J', refaddr $self}}; } sub min($self) { @@ -3868,7 +3855,7 @@ sub trace { return main::trace(@_); } # and having to worry about changing it as ranges are added and # deleted. - my $addr = do { no overloading; pack 'J', $self; }; + my $addr = pack 'J', refaddr $self; # If the range list is empty, return a large value that isn't adjacent # to any that could be in the range list, for simpler tests @@ -3889,8 +3876,7 @@ sub trace { return main::trace(@_); } # range[$i-1]->end < $codepoint <= range[$i]->end # So is in the table if and only iff it is at least the start position # of range $i. - no overloading; - return 0 if $ranges{pack 'J', $self}->[$i]->start > $codepoint; + return 0 if $ranges{pack 'J', refaddr $self}->[$i]->start > $codepoint; return $i + 1; } @@ -3900,8 +3886,7 @@ sub trace { return main::trace(@_); } return unless $i; # contains() returns 1 beyond where we should look - no overloading; - return $ranges{pack 'J', $self}->[$i-1]; + return $ranges{pack 'J', refaddr $self}->[$i-1]; } sub value_of($self, $codepoint) { @@ -3927,7 +3912,7 @@ sub trace { return main::trace(@_); } # range[$i-1]->end < $codepoint <= range[$i]->end # Returns undef if no such $i is possible (e.g. at end of table), or # if there is an error. - my $addr = do { no overloading; pack 'J', $self; }; + my $addr = pack 'J', refaddr $self; return if $code_point > $max{$addr}; my $r = $ranges{$addr}; # The current list of ranges @@ -4115,7 +4100,7 @@ sub trace { return main::trace(@_); } Carp::carp_extra_args(\%args) if main::DEBUG && %args; - my $addr = do { no overloading; pack 'J', $self; }; + my $addr = pack 'J', refaddr $self; if ($operation ne '+' && $operation ne '-') { Carp::my_carp_bug("$owner_name_of{$addr}First parameter to _add_delete must be '+' or '-'. No action taken."); @@ -4760,15 +4745,14 @@ sub trace { return main::trace(@_); } } sub reset_each_range($self) { # reset the iterator for each_range(); - no overloading; - undef $each_range_iterator{pack 'J', $self}; + undef $each_range_iterator{pack 'J', refaddr $self}; return; } sub each_range($self) { # Iterate over each range in a range list. Results are undefined if # the range list is changed during the iteration. - my $addr = do { no overloading; pack 'J', $self; }; + my $addr = pack 'J', refaddr $self; return if $self->is_empty; @@ -4782,7 +4766,7 @@ sub trace { return main::trace(@_); } } sub count($self) { # Returns count of code points in range list - my $addr = do { no overloading; pack 'J', $self; }; + my $addr = pack 'J', refaddr $self; my $count = 0; foreach my $range (@{$ranges{$addr}}) { @@ -4796,15 +4780,14 @@ sub trace { return main::trace(@_); } } sub is_empty($self) { # Returns boolean as to if a range list is empty - no overloading; - return scalar @{$ranges{pack 'J', $self}} == 0; + return scalar @{$ranges{pack 'J', refaddr $self}} == 0; } sub hash($self) { # Quickly returns a scalar suitable for separating tables into # buckets, i.e. it is a hash function of the contents of a table, so # there are relatively few conflicts. - my $addr = do { no overloading; pack 'J', $self; }; + my $addr = pack 'J', refaddr $self; # These are quickly computable. Return looks like 'min..max;count' return $self->min . "..$max{$addr};" . scalar @{$ranges{$addr}}; @@ -5371,7 +5354,7 @@ sub trace { return main::trace(@_); } my $class = shift; my $self = bless \do { my $anonymous_scalar }, $class; - my $addr = do { no overloading; pack 'J', $self; }; + my $addr = pack 'J', refaddr $self; my %args = @_; @@ -5556,8 +5539,7 @@ END sub ranges { # Returns the array of ranges associated with this table. - no overloading; - return $range_list{pack 'J', shift}->ranges; + return $range_list{pack 'J', refaddr shift}->ranges; } sub add_alias { @@ -5598,7 +5580,7 @@ END # release $name = ucfirst($name) unless $name =~ /^k[A-Z]/; - my $addr = do { no overloading; pack 'J', $self; }; + my $addr = pack 'J', refaddr $self; # Figure out if should be loosely matched if not already specified. if (! defined $loose_match) { @@ -5659,8 +5641,7 @@ END # This name may be shorter than any existing ones, so clear the cache # of the shortest, so will have to be recalculated. - no overloading; - undef $short_name{pack 'J', $self}; + undef $short_name{pack 'J', refaddr $self}; return; } @@ -5679,7 +5660,7 @@ END # Any name with alphabetics is preferred over an all numeric one, even # if longer. - my $addr = do { no overloading; pack 'J', $self; }; + my $addr = pack 'J', refaddr $self; # For efficiency, don't recalculate, but this means that adding new # aliases could change what the shortest is, so the code that does @@ -5782,15 +5763,13 @@ END } sub add_description($self, $description) { # Adds the parameter as a short description. - no overloading; - push @{$description{pack 'J', $self}}, $description; + push @{$description{pack 'J', refaddr $self}}, $description; return; } sub add_note($self, $note) { # Adds the parameter as a short note. - no overloading; - push @{$note{pack 'J', $self}}, $note; + push @{$note{pack 'J', refaddr $self}}, $note; return; } @@ -5801,8 +5780,7 @@ END chomp $comment; - no overloading; - push @{$comment{pack 'J', $self}}, $comment; + push @{$comment{pack 'J', refaddr $self}}, $comment; return; } @@ -5812,7 +5790,7 @@ END # context, returns the array of comments. In scalar, returns a string # of each element joined together with a period ending each. - my $addr = do { no overloading; pack 'J', $self; }; + my $addr = pack 'J', refaddr $self; my @list = @{$comment{$addr}}; return @list if wantarray; my $return = ""; @@ -5829,7 +5807,7 @@ END # Initialize the table with the argument which is any valid # initialization for range lists. - my $addr = do { no overloading; pack 'J', $self; }; + my $addr = pack 'J', refaddr $self; # Replace the current range list with a new one of the same exact # type. @@ -5883,7 +5861,7 @@ END # a range equals this one, don't write # the range - my $addr = do { no overloading; pack 'J', $self; }; + my $addr = pack 'J', refaddr $self; my $write_as_invlist = $write_as_invlist{$addr}; # Start with the header @@ -6539,7 +6517,7 @@ END sub set_status($self, $status, $info) { # Set the table's status # status The status enum value # info Any message associated with it. - my $addr = do { no overloading; pack 'J', $self; }; + my $addr = pack 'J', refaddr $self; $status{$addr} = $status; $status_info{$addr} = $info; @@ -6547,7 +6525,7 @@ END } sub set_fate($self, $fate, $reason=undef) { # Set the fate of a table - my $addr = do { no overloading; pack 'J', $self; }; + my $addr = pack 'J', refaddr $self; return if $fate{$addr} == $fate; # If no-op @@ -6581,7 +6559,7 @@ END # Don't allow changes to the table from now on. This stores a stack # trace of where it was called, so that later attempts to modify it # can immediately show where it got locked. - my $addr = do { no overloading; pack 'J', $self; }; + my $addr = pack 'J', refaddr $self; $locked{$addr} = ""; @@ -6605,7 +6583,7 @@ END sub carp_if_locked($self) { # Return whether a table is locked or not, and, by the way, complain # if is locked - my $addr = do { no overloading; pack 'J', $self; }; + my $addr = pack 'J', refaddr $self; return 0 if ! $locked{$addr}; Carp::my_carp_bug("Can't modify a locked table. Stack trace of locking:\n$locked{$addr}\n\n"); @@ -6613,8 +6591,7 @@ END } sub set_file_path($self, @path) { # Set the final directory path for this table - no overloading; - @{$file_path{pack 'J', $self}} = @path; + @{$file_path{pack 'J', refaddr $self}} = @path; return } @@ -6756,7 +6733,7 @@ sub trace { return main::trace(@_); } Write_As_Invlist => 0, %args); - my $addr = do { no overloading; pack 'J', $self; }; + my $addr = pack 'J', refaddr $self; $anomalous_entries{$addr} = []; $default_map{$addr} = $default_map; @@ -6816,7 +6793,7 @@ sub trace { return main::trace(@_); } sub append_to_body($self) { # Adds to the written HERE document of the table's body any anomalous # entries in the table.. - my $addr = do { no overloading; pack 'J', $self; }; + my $addr = pack 'J', refaddr $self; return "" unless @{$anomalous_entries{$addr}}; return join("\n", @{$anomalous_entries{$addr}}) . "\n"; @@ -6865,7 +6842,7 @@ sub trace { return main::trace(@_); } . " present, must be 'full_name'"); } - my $addr = do { no overloading; pack 'J', $self; }; + my $addr = pack 'J', refaddr $self; # Convert the input to the standard equivalent, if any (won't have any # for $STRING properties) @@ -6910,7 +6887,7 @@ sub trace { return main::trace(@_); } sub to_output_map($self) { # Returns boolean: should we write this map table? - my $addr = do { no overloading; pack 'J', $self; }; + my $addr = pack 'J', refaddr $self; # If overridden, use that return $to_output_map{$addr} if defined $to_output_map{$addr}; @@ -6988,7 +6965,7 @@ END # No sense generating a comment if aren't going to write it out. return if ! $self->to_output_map; - my $addr = do { no overloading; pack 'J', $self; }; + my $addr = pack 'J', refaddr $self; my $property = $self->property; @@ -7167,7 +7144,7 @@ END # Called in the middle of write when it finds a range it doesn't know # how to handle. - my $addr = do { no overloading; pack 'J', $self; }; + my $addr = pack 'J', refaddr $self; my $type = $range->type; @@ -7309,7 +7286,7 @@ END # be for all ranges missing from it. It also includes any code points # which have map_types that don't go in the main table. - my $addr = do { no overloading; pack 'J', $self; }; + my $addr = pack 'J', refaddr $self; my $name = $self->property->swash_name; @@ -7408,7 +7385,7 @@ END sub write($self) { # Write the table to the file. - my $addr = do { no overloading; pack 'J', $self; }; + my $addr = pack 'J', refaddr $self; # Clear the temporaries undef @multi_code_point_maps; @@ -7675,7 +7652,7 @@ sub trace { return main::trace(@_); } Format => $EMPTY_FORMAT, Write_As_Invlist => 1, ); - my $addr = do { no overloading; pack 'J', $self; }; + my $addr = pack 'J', refaddr $self; $conflicting{$addr} = [ ]; $equivalents{$addr} = [ ]; @@ -7839,7 +7816,7 @@ sub trace { return main::trace(@_); } # be an optional parameter. Carp::carp_extra_args(\@_) if main::DEBUG && @_; - my $addr = do { no overloading; pack 'J', $self; }; + my $addr = pack 'J', refaddr $self; # Check if the conflicting name is exactly the same as any existing # alias in this table (as long as there is a real object there to @@ -7882,8 +7859,7 @@ sub trace { return main::trace(@_); } } # Two tables are equivalent if they have the same leader. - no overloading; - return $leader{pack 'J', $self} == $leader{pack 'J', $other}; + return $leader{pack 'J', refaddr $self} == $leader{pack 'J', refaddr $other}; return; } @@ -7920,7 +7896,7 @@ sub trace { return main::trace(@_); } my $are_equivalent = $self->is_set_equivalent_to($other); return if ! defined $are_equivalent || $are_equivalent; - my $addr = do { no overloading; pack 'J', $self; }; + my $addr = pack 'J', refaddr $self; my $current_leader = ($related) ? $parent{$addr} : $leader{$addr}; if ($related) { @@ -7959,8 +7935,8 @@ sub trace { return main::trace(@_); } return; } - my $leader = do { no overloading; pack 'J', $current_leader; }; - my $other_addr = do { no overloading; pack 'J', $other; }; + my $leader = pack 'J', refaddr $current_leader; + my $other_addr = pack 'J', refaddr $other; # Any tables that are equivalent to or children of this table must now # instead be equivalent to or (children) to the new leader (parent), @@ -7977,7 +7953,7 @@ sub trace { return main::trace(@_); } next if $table == $other; trace "setting $other to be the leader of $table, status=$status" if main::DEBUG && $to_trace; - my $table_addr = do { no overloading; pack 'J', $table; }; + my $table_addr = pack 'J', refaddr $table; $leader{$table_addr} = $other; $matches_all{$table_addr} = $matches_all; $self->_set_range_list($other->_range_list); @@ -8010,8 +7986,7 @@ sub trace { return main::trace(@_); } Carp::my_carp_bug("Can't set $self to be the complement of $other, which itself is the complement of " . $other->complement); return; } - my $addr = do { no overloading; pack 'J', $self; }; - $complement{$addr} = $other; + $complement{pack 'J', refaddr $self} = $other; # Be sure the other property knows we are depending on them; or the # other table if it is one in the current property. @@ -8299,7 +8274,7 @@ sub trace { return main::trace(@_); } return unless $debugging_build; - my $addr = do { no overloading; pack 'J', $leader; }; + my $addr = pack 'J', refaddr $leader; if ($leader{$addr} != $leader) { Carp::my_carp_bug(<<END @@ -8367,7 +8342,7 @@ END && $parent == $property->table('N') && defined (my $yes = $property->table('Y'))) { - my $yes_addr = do { no overloading; pack 'J', $yes; }; + my $yes_addr = pack 'J', refaddr $yes; @yes_perl_synonyms = grep { $_->property == $perl } main::uniques($yes, @@ -8383,12 +8358,12 @@ END my @conflicting; # Will hold the table conflicts. # Look at the parent, any yes synonyms, and all the children - my $parent_addr = do { no overloading; pack 'J', $parent; }; + my $parent_addr = pack 'J', refaddr $parent; for my $table ($parent, @yes_perl_synonyms, @{$children{$parent_addr}}) { - my $table_addr = do { no overloading; pack 'J', $table; }; + my $table_addr = pack 'J', refaddr $table; my $table_property = $table->property; # Tables are separated by a blank line to create a grouping. @@ -8853,7 +8828,7 @@ sub trace { return main::trace(@_) if main::DEBUG && $to_trace } my %args = @_; $self = bless \do { my $anonymous_scalar }, $class; - my $addr = do { no overloading; pack 'J', $self; }; + my $addr = pack 'J', refaddr $self; $directory{$addr} = delete $args{'Directory'}; $file{$addr} = delete $args{'File'}; @@ -8916,8 +8891,7 @@ sub trace { return main::trace(@_) if main::DEBUG && $to_trace } return; } else { - no overloading; - $map{pack 'J', $self}->delete_range($other, $other); + $map{pack 'J', refaddr $self}->delete_range($other, $other); } return $self; } @@ -8930,7 +8904,7 @@ sub trace { return main::trace(@_) if main::DEBUG && $to_trace } my $name = shift; my %args = @_; - my $addr = do { no overloading; pack 'J', $self; }; + my $addr = pack 'J', refaddr $self; my $table = $table_ref{$addr}{$name}; my $standard_name = main::standardize($name); @@ -9004,7 +8978,7 @@ sub trace { return main::trace(@_) if main::DEBUG && $to_trace } sub delete_match_table($self, $table_to_remove) { # Delete the table referred to by $2 from the property $1. - my $addr = do { no overloading; pack 'J', $self; }; + my $addr = pack 'J', refaddr $self; # Remove all names that refer to it. foreach my $key (keys %{$table_ref{$addr}}) { @@ -9019,7 +8993,7 @@ sub trace { return main::trace(@_) if main::DEBUG && $to_trace } sub table($self, $name) { # Return a pointer to the match table (with name given by the # parameter) associated with this property; undef if none. - my $addr = do { no overloading; pack 'J', $self; }; + my $addr = pack 'J', refaddr $self; return $table_ref{$addr}{$name} if defined $table_ref{$addr}{$name}; @@ -9037,8 +9011,7 @@ sub trace { return main::trace(@_) if main::DEBUG && $to_trace } # Return a list of pointers to all the match tables attached to this # property - no overloading; - return main::uniques(values %{$table_ref{pack 'J', shift}}); + return main::uniques(values %{$table_ref{pack 'J', refaddr shift}}); } sub directory { @@ -9047,7 +9020,7 @@ sub trace { return main::trace(@_) if main::DEBUG && $to_trace } # priority; 'undef' is returned if the type isn't defined; # or $map_directory for everything else. - my $addr = do { no overloading; pack 'J', shift; }; + my $addr = pack 'J', refaddr shift; return $directory{$addr} if defined $directory{$addr}; return undef if $type{$addr} == $UNKNOWN; @@ -9064,7 +9037,7 @@ sub trace { return main::trace(@_) if main::DEBUG && $to_trace } # but otherwise the standard name is used. This is different from the # external_name, so that the rest of the files, like in lib can use # the standard name always, without regard to historical precedent. - my $addr = do { no overloading; pack 'J', $self; }; + my $addr = pack 'J', refaddr $self; # Swash names are used only on either # 1) regular or internal-only map tables @@ -9085,7 +9058,7 @@ sub trace { return main::trace(@_) if main::DEBUG && $to_trace } # The whole point of this pseudo property is match tables. return 1 if $self == $perl; - my $addr = do { no overloading; pack 'J', $self; }; + my $addr = pack 'J', refaddr $self; # Don't generate tables of code points that match the property values # of a string property. Such a list would most likely have many @@ -9112,8 +9085,7 @@ sub trace { return main::trace(@_) if main::DEBUG && $to_trace } return; } - no overloading; - return $map{pack 'J', $self}->map_add_or_replace_non_nulls($map{pack 'J', $other}); + return $map{pack 'J', refaddr $self}->map_add_or_replace_non_nulls($map{pack 'J', refaddr $other}); } sub set_proxy_for { @@ -9149,7 +9121,7 @@ sub trace { return main::trace(@_) if main::DEBUG && $to_trace } return; } - { no overloading; $type{pack 'J', $self} = $type; } + $type{pack 'J', refaddr $self} = $type; return if $type != $BINARY && $type != $FORCED_BINARY; my $yes = $self->table('Y'); @@ -9188,7 +9160,7 @@ sub trace { return main::trace(@_) if main::DEBUG && $to_trace } my $map = shift; # What the range maps to. # Rest of parameters passed on. - my $addr = do { no overloading; pack 'J', $self; }; + my $addr = pack 'J', refaddr $self; # If haven't the type of the property, gather information to figure it # out. @@ -9237,7 +9209,7 @@ sub trace { return main::trace(@_) if main::DEBUG && $to_trace } # We have been keeping track of what the property values have been, # and now have the necessary information to figure out the type. - my $addr = do { no overloading; pack 'J', $self; }; + my $addr = pack 'J', refaddr $self; my $type = $type{$addr}; @@ -9293,7 +9265,7 @@ sub trace { return main::trace(@_) if main::DEBUG && $to_trace } # $reaons - Ignored unless suppressing sub set_fate($self, $fate, $reason=undef) { - my $addr = do { no overloading; pack 'J', $self; }; + my $addr = pack 'J', refaddr $self; if ($fate >= $SUPPRESSED) { $why_suppressed{$self->complete_name} = $reason; } @@ -9371,8 +9343,7 @@ sub trace { return main::trace(@_) if main::DEBUG && $to_trace } *$sub = sub { use strict "refs"; my $self = shift; - no overloading; - return $map{pack 'J', $self}->$sub(@_); + return $map{pack 'J', refaddr $self}->$sub(@_); } } @@ -9785,7 +9756,7 @@ sub UCD_name ($table, $alias) { else { # Keep track of cycles in the input, and refuse to infinitely loop - my $addr = do { no overloading; pack 'J', $item; }; + my $addr = pack 'J', refaddr $item; if (defined $main::already_output{$addr}) { return "${indent}ALREADY OUTPUT: $item\n"; } @@ -9903,7 +9874,7 @@ sub dump_inside_out( $object, $fields_ref ) { # Dump inside-out hashes in an object's state by converting them to a # regular hash and then calling simple_dumper on that. - my $addr = do { no overloading; pack 'J', $object; }; + my $addr = pack 'J', refaddr $object; my %hash; foreach my $key (keys %$fields_ref) { @@ -9924,7 +9895,7 @@ sub _operator_dot($self, $other="", $reversed=0) { } else { my $ref = ref $$which; - my $addr = do { no overloading; pack 'J', $$which; }; + my $addr = pack 'J', refaddr $$which; $$which = "$ref ($addr)"; } } @@ -10928,7 +10899,7 @@ sub output_perl_charnames_line ($code_point, $name) { $file->carp_bad_line("Unexpected property '$property_name'. Skipped"); next LINE; } - { no overloading; $property_addr = pack 'J', $property_object; } + $property_addr = pack 'J', refaddr $property_object; # Defer changing names until have a line that is acceptable # (the 'next' statement above means is unacceptable) @@ -10980,7 +10951,7 @@ sub output_perl_charnames_line ($code_point, $name) { if $file->has_missings_defaults; foreach my $default_ref (@missings_list) { my $default = $default_ref->[0]; - my $addr = do { no overloading; pack 'J', property_ref($default_ref->[1]); }; + my $addr = pack 'J', refaddr property_ref($default_ref->[1]); # For string properties, the default is just what the # file says, but non-string properties should already diff --git a/lib/unicore/uni_keywords.pl b/lib/unicore/uni_keywords.pl index ce6779e2d1..926e0d895b 100644 --- a/lib/unicore/uni_keywords.pl +++ b/lib/unicore/uni_keywords.pl @@ -1319,7 +1319,7 @@ # 43f6df50e4878f501b417e366b0ee097ae5ccb2d4ce942026bed3d62d78e7887 lib/unicore/extracted/DLineBreak.txt # a04502ebb36a45d83cbe48a7d8132ea8143edb7b3d34d0aa6afe4a9685049741 lib/unicore/extracted/DNumType.txt # 11075771b112e8e7ccf6ffa637c4c91eadc3ef3db0517b24e605df8fd3624239 lib/unicore/extracted/DNumValues.txt -# bbe28a1f209e4a9f6172673b5109f13d00819c7d749068c7dc89459517f61830 lib/unicore/mktables +# 8b1c80fb062345cd9c4febce79fc06d92e1bf642d83d404dc702acd293f13845 lib/unicore/mktables # c72bbdeda99714db1c8024d3311da4aef3c0db3b9b9f11455a7cfe10d5e9aba3 lib/unicore/version # 0a6b5ab33bb1026531f816efe81aea1a8ffcd34a27cbea37dd6a70a63d73c844 regen/charset_translations.pl # 5f8520d3a17ade6317fc0c423f5091470924b1ef425bca0c41ce8e4a9f8460fe regen/mk_PL_charclass.pl diff --git a/regcharclass.h b/regcharclass.h index bfecd79a1a..3226b2efcd 100644 --- a/regcharclass.h +++ b/regcharclass.h @@ -3762,7 +3762,7 @@ * 43f6df50e4878f501b417e366b0ee097ae5ccb2d4ce942026bed3d62d78e7887 lib/unicore/extracted/DLineBreak.txt * a04502ebb36a45d83cbe48a7d8132ea8143edb7b3d34d0aa6afe4a9685049741 lib/unicore/extracted/DNumType.txt * 11075771b112e8e7ccf6ffa637c4c91eadc3ef3db0517b24e605df8fd3624239 lib/unicore/extracted/DNumValues.txt - * bbe28a1f209e4a9f6172673b5109f13d00819c7d749068c7dc89459517f61830 lib/unicore/mktables + * 8b1c80fb062345cd9c4febce79fc06d92e1bf642d83d404dc702acd293f13845 lib/unicore/mktables * c72bbdeda99714db1c8024d3311da4aef3c0db3b9b9f11455a7cfe10d5e9aba3 lib/unicore/version * 0a6b5ab33bb1026531f816efe81aea1a8ffcd34a27cbea37dd6a70a63d73c844 regen/charset_translations.pl * 1aa94679c695efd507b7e4491629dba1021b74c21a5324dfd3a582a5d654bd32 regen/regcharclass.pl diff --git a/uni_keywords.h b/uni_keywords.h index 1276aa20ea..672274bf16 100644 --- a/uni_keywords.h +++ b/uni_keywords.h @@ -7697,7 +7697,7 @@ MPH_VALt match_uniprop( const unsigned char * const key, const U16 key_len ) { * 43f6df50e4878f501b417e366b0ee097ae5ccb2d4ce942026bed3d62d78e7887 lib/unicore/extracted/DLineBreak.txt * a04502ebb36a45d83cbe48a7d8132ea8143edb7b3d34d0aa6afe4a9685049741 lib/unicore/extracted/DNumType.txt * 11075771b112e8e7ccf6ffa637c4c91eadc3ef3db0517b24e605df8fd3624239 lib/unicore/extracted/DNumValues.txt - * bbe28a1f209e4a9f6172673b5109f13d00819c7d749068c7dc89459517f61830 lib/unicore/mktables + * 8b1c80fb062345cd9c4febce79fc06d92e1bf642d83d404dc702acd293f13845 lib/unicore/mktables * c72bbdeda99714db1c8024d3311da4aef3c0db3b9b9f11455a7cfe10d5e9aba3 lib/unicore/version * 0a6b5ab33bb1026531f816efe81aea1a8ffcd34a27cbea37dd6a70a63d73c844 regen/charset_translations.pl * 5f8520d3a17ade6317fc0c423f5091470924b1ef425bca0c41ce8e4a9f8460fe regen/mk_PL_charclass.pl |