summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2010-10-09 17:58:11 -0600
committerFather Chrysostomos <sprout@cpan.org>2010-10-12 13:50:03 -0700
commit0a9dbafce21ad4191e66a5fde3186bb2e61ca726 (patch)
treed22c3a95b7dcf7c9623fb50e147c439cb1969a8a /lib
parentd69c231bf7fcba3a2291612fb1b8f0cbf105e4e6 (diff)
downloadperl-0a9dbafce21ad4191e66a5fde3186bb2e61ca726.tar.gz
mktables: Add type_of() method to get range's type
This will be useful in outputting better annotations.
Diffstat (limited to 'lib')
-rw-r--r--lib/unicore/mktables16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/unicore/mktables b/lib/unicore/mktables
index de3bd0d403..b03c9358e6 100644
--- a/lib/unicore/mktables
+++ b/lib/unicore/mktables
@@ -2875,6 +2875,20 @@ sub trace { return main::trace(@_); }
return $range->value;
}
+ sub type_of {
+ # Returns the type of the range containing the code point, undef if
+ # the code point is not in the table
+
+ my $self = shift;
+ my $codepoint = shift;
+ Carp::carp_extra_args(\@_) if main::DEBUG && @_;
+
+ my $range = $self->containing_range($codepoint);
+ return unless defined $range;
+
+ return $range->type;
+ }
+
sub _search_ranges {
# Find the range in the list which contains a code point, or where it
# should go if were to add it. That is, it returns $i, such that:
@@ -4832,6 +4846,7 @@ sub trace { return main::trace(@_); }
min
range_count
reset_each_range
+ type_of
value_of
))
{
@@ -7192,6 +7207,7 @@ sub trace { return main::trace(@_) if main::DEBUG && $to_trace }
status
status_info
to_output_map
+ type_of
value_of
write
))