From 2a4f2769673ad98ec79b60fe7cd4d1b0a6569d29 Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Fri, 30 Dec 2011 08:37:04 -0700 Subject: [PATCH] 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. --- lib/Unicode/UCD.pm | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/Unicode/UCD.pm b/lib/Unicode/UCD.pm index db95111..38f0c3b 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; -- 2.7.4