diff options
author | Karl Williamson <khw@khw-desktop.(none)> | 2009-12-30 09:36:52 -0700 |
---|---|---|
committer | Rafael Garcia-Suarez <rgs@consttype.org> | 2010-01-15 16:32:31 +0100 |
commit | 0c07e5386c2f08c01ea359e36ce78758337a20b7 (patch) | |
tree | e7009e2028c44e2c7b07ce077ec5a614a8a45982 /lib | |
parent | 5747a2f6732071d6477abc45c2e06d557f1a6c8a (diff) | |
download | perl-0c07e5386c2f08c01ea359e36ce78758337a20b7.tar.gz |
This adds a constructor option to not output the comments containing the range counts; and uses that option on Decomposition.pl, used by normalize.pm.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/unicore/mktables | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/lib/unicore/mktables b/lib/unicore/mktables index 1101912fc2..3771ea6826 100644 --- a/lib/unicore/mktables +++ b/lib/unicore/mktables @@ -4074,6 +4074,12 @@ sub trace { return main::trace(@_); } # standard. main::set_access('perl_extension', \%perl_extension, 'r'); + my %output_range_counts; + # A boolean set iff this table is to have comments written in the + # output file that contain the number of code points in the range. + # The constructor can override the global flag of the same name. + main::set_access('output_range_counts', \%output_range_counts, 'r'); + sub new { # All arguments are key => value pairs, which you can see below, most # of which match fields documented above. Otherwise: Pod_Entry, @@ -4095,6 +4101,7 @@ sub trace { return main::trace(@_); } my $complete_name = $complete_name{$addr} = delete $args{'Complete_Name'}; $internal_only{$addr} = delete $args{'Internal_Only_Warning'} || 0; + $output_range_counts{$addr} = delete $args{'Output_Range_Counts'}; $property{$addr} = delete $args{'_Property'}; $range_list{$addr} = delete $args{'_Range_List'}; $status{$addr} = delete $args{'Status'} || $NORMAL; @@ -4114,6 +4121,8 @@ sub trace { return main::trace(@_); } # Can't use || above because conceivably the name could be 0, and # can't use // operator in case this program gets used in Perl 5.8 $full_name{$addr} = $name{$addr} if ! defined $full_name{$addr}; + $output_range_counts{$addr} = $output_range_counts if + ! defined $output_range_counts{$addr}; $aliases{$addr} = [ ]; $comment{$addr} = [ ]; @@ -4564,7 +4573,7 @@ sub trace { return main::trace(@_); } # Add a comment with the size of the range, if requested. # Expand Tabs to make sure they all start in the same # column, and then unexpand to use mostly tabs. - if (! $output_range_counts) { + if (! $output_range_counts{$addr}) { $OUT[-1] .= "\n"; } else { @@ -5170,7 +5179,7 @@ START\\tSTOP\\tMAPPING where START is the starting code point of the range, in hex; STOP is the ending point, or if omitted, the range has just one code point; MAPPING is what each code point between START and STOP maps to. END - if ($output_range_counts) { + if ($self->output_range_counts) { $comment .= <<END; Numbers in comments in [brackets] indicate how many code points are in the range (omitted when the range is a single code point or if the mapping is to @@ -6406,7 +6415,7 @@ END START\\tSTOP\\twhere START is the starting code point of the range, in hex; STOP is the ending point, or if omitted, the range has just one code point. END - if ($output_range_counts) { + if ($leader->output_range_counts) { $comment .= <<END; Numbers in comments in [brackets] indicate how many code points are in the range. @@ -8977,6 +8986,9 @@ END Perl_Extension => 1, Default_Map => $CODE_POINT, + # normalize.pm can't cope with these + Output_Range_Counts => 0, + # This is a specially formatted table # explicitly for normalize.pm, which # is expecting a particular format, |