From 11ef8fddd64f78304dc923b07dffddd7a4f28074 Mon Sep 17 00:00:00 2001 From: Jarkko Hietaniemi Date: Sun, 21 Apr 2002 22:24:52 +0000 Subject: Make writing user-defined character properties nicer. p4raw-id: //depot/perl@16054 --- lib/utf8_heavy.pl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'lib/utf8_heavy.pl') diff --git a/lib/utf8_heavy.pl b/lib/utf8_heavy.pl index 29d4ac2c7d..d5a0b335c2 100644 --- a/lib/utf8_heavy.pl +++ b/lib/utf8_heavy.pl @@ -184,7 +184,13 @@ sub SWASHNEW { print STDERR "$1 => $2\n" if DEBUG; if ($char =~ /[-+!]/) { my ($c,$t) = split(/::/, $name, 2); # bogus use of ::, really - my $subobj = $c->SWASHNEW($t, "", 0, 0, 0); + my $subobj; + if ($c eq 'utf8') { + $subobj = $c->SWASHNEW($t, "", 0, 0, 0); + } + elsif ($c =~ /^([0-9a-fA-F]+)/) { + $subobj = utf8->SWASHNEW("", $c, 0, 0, 0); + } return $subobj unless ref $subobj; push @extras, $name => $subobj; $bits = $subobj->{BITS} if $bits < $subobj->{BITS}; -- cgit v1.2.1