summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2011-11-05 08:34:00 -0600
committerKarl Williamson <public@khwilliamson.com>2011-11-08 08:09:32 -0700
commit0fada5e1f4aafccee16d425b124c1424f7bc95d7 (patch)
tree911c08d91abb3ea12e7fde359b07dce68cde1a55
parent7ef25837157389e073e4677bb3ca144185b4b37c (diff)
downloadperl-0fada5e1f4aafccee16d425b124c1424f7bc95d7.tar.gz
utf8_heavy.pl: Return that property is user-defined
This adds an element to the returned hash that is a boolean as to whether or not the property is user-defined.
-rw-r--r--lib/utf8_heavy.pl7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/utf8_heavy.pl b/lib/utf8_heavy.pl
index 88cc299b02..9903128273 100644
--- a/lib/utf8_heavy.pl
+++ b/lib/utf8_heavy.pl
@@ -43,6 +43,7 @@ sub _loose_name ($) {
sub SWASHNEW {
my ($class, $type, $list, $minbits, $none) = @_;
+ my $user_defined = 0;
local $^D = 0 if $^D;
$class = "" unless defined $class;
@@ -90,6 +91,8 @@ sub _loose_name ($) {
# same meanings as the input parameters.
# SPECIALS contains a reference to any special-treatment hash in the
# INVERT_IT is non-zero if the result should be inverted before use
+ # USER_DEFINED is non-zero if the result came from a user-defined
+ # property.
my $file; ## file to load data from, and also part of the %Cache key.
my $ListSorted = 0;
@@ -142,6 +145,7 @@ sub _loose_name ($) {
if $tainted;
no strict 'refs';
$list = &{$prop}($caseless);
+ $user_defined = 1;
last GETFILE;
}
}
@@ -534,7 +538,7 @@ sub _loose_name ($) {
}
if (DEBUG) {
- print STDERR __LINE__, ": CLASS = $class, TYPE => $type, BITS => $bits, NONE => $none, INVERT_IT => $invert_it";
+ print STDERR __LINE__, ": CLASS = $class, TYPE => $type, BITS => $bits, NONE => $none, INVERT_IT => $invert_it, USER_DEFINED => $user_defined";
print STDERR "\nLIST =>\n$list" if defined $list;
print STDERR "\nEXTRAS =>\n$extras" if defined $extras;
print STDERR "\n";
@@ -546,6 +550,7 @@ sub _loose_name ($) {
EXTRAS => $extras,
LIST => $list,
NONE => $none,
+ USER_DEFINED => $user_defined,
@extras,
} => $class;