not good because the script context is not shown.
p4raw-id: //depot/perl@15581
## If we reach this line, it's because we couldn't figure
## out what to do with $type. Ouch.
##
- croak("Can't find Unicode character property \"$type\"");
+
+ return $type;
}
print "found it (file='$file')\n" if DEBUG;
if ($char =~ /[-+!]/) {
my ($c,$t) = split(/::/, $name, 2); # bogus use of ::, really
my $subobj = $c->SWASHNEW($t, "", 0, 0, 0);
+ return $subobj unless ref $subobj;
push @extras, $name => $subobj;
$bits = $subobj->{BITS} if $bits < $subobj->{BITS};
}
=item Can't find %s property definition %s
(F) You may have tried to use C<\p> which means a Unicode property for
-example \p{Lu} is all uppercase letters. Escape the C<\p>, either
+example \p{Lu} is all uppercase letters. if you did mean to use a
+Unicode property, see L<perlunicode> for the list of known properties.
+If you didn't mean to use a Unicode property, escape the C<\p>, either
C<\\p> (just the C<\p>) or by C<\Q\p> (the rest of the string, until
possible C<\E>).
$| = 1;
-print "1..903\n";
+print "1..908\n";
BEGIN {
chdir 't' if -d 't';
# This is not really a regex test but regexes bring
# out the issue nicely.
use strict;
+ my $test = 893;
my $u3 = "f\x{df}\x{100}";
my $u2 = substr($u3,0,2);
my $u1 = substr($u2,0,1);
{
print "# qr/.../x\n";
+ my $test = 904;
my $R = qr/ A B C # D E/x;
print eval {"ABCDE" =~ m/($R)/} ? "ok $test\n" : "not ok $test\n";
$test++;
}
+
+{
+ print "# illegal Unicode properties\n";
+ my $test = 907;
+
+ print eval { "a" =~ /\pq / } ? "not ok $test\n" : "ok $test\n";
+ $test++;
+
+ print eval { "a" =~ /\p{qrst} / } ? "not ok $test\n" : "ok $test\n";
+ $test++;
+}
Copy(pv, PL_tokenbuf, len+1, char);
PL_curcop->op_private = PL_hints;
}
- if (!SvROK(retval) || SvTYPE(SvRV(retval)) != SVt_PVHV)
+ if (!SvROK(retval) || SvTYPE(SvRV(retval)) != SVt_PVHV) {
+ if (SvPOK(retval))
+ Perl_croak(aTHX_ "Can't find Unicode property definition \"%s\"",
+ SvPV_nolen(retval));
Perl_croak(aTHX_ "SWASHNEW didn't return an HV ref");
+ }
return retval;
}