summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2011-12-30 08:37:04 -0700
committerKarl Williamson <public@khwilliamson.com>2011-12-30 11:08:29 -0700
commit2a4f2769673ad98ec79b60fe7cd4d1b0a6569d29 (patch)
tree472f5e5d8cb56eda2d86033633ff163c5a7c3784
parentc887f93f9d03c5d125f319a4322e94615be456d9 (diff)
downloadperl-2a4f2769673ad98ec79b60fe7cd4d1b0a6569d29.tar.gz
Unicode::UCD: Special case prop_aliases() 'indic'
This is in preparation for Unicode 6.1 which adds a property whose name begins with 'indic', as in Indic languages. This creates a conflict with Perl's longstanding use of 'in' as a prefix in a property name. "\p{infoo}" is a synonym for "\p{blk=foo}". The conflict is resolved here with a special case.
-rw-r--r--lib/Unicode/UCD.pm12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/Unicode/UCD.pm b/lib/Unicode/UCD.pm
index db95111947..38f0c3bfb1 100644
--- a/lib/Unicode/UCD.pm
+++ b/lib/Unicode/UCD.pm
@@ -1623,8 +1623,16 @@ sub prop_aliases ($) {
# Here, it wasn't one of the gc or script single-form
# extensions. It could be a block property single-form
# extension. An 'in' prefix definitely means that, and should
- # be looked up without the prefix.
- my $began_with_in = $loose =~ s/^in//;
+ # be looked up without the prefix. However, starting in
+ # Unicode 6.1, we have to special case 'indic...', as there
+ # is a property that begins with that name. We shouldn't
+ # strip the 'in' from that. I'm (khw) generalizing this to
+ # 'indic' instead of the single property, because I suspect
+ # that others of this class may come along in the future.
+ # However, this could backfire and a block created whose name
+ # begins with 'dic...', and we would want to strip the 'in'.
+ # At which point this would have to be tweaked.
+ my $began_with_in = $loose =~ s/^in(?!dic)//;
@list = prop_value_aliases("block", $loose);
if (@list) {
map { $_ =~ s/^/In_/ } @list;