From: Jeff Pinyan Date: Thu, 24 Jun 2004 16:42:54 +0000 (-0400) Subject: regcomp.c, t/op/regmesg.t -- False range with \p and \P X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f81125e29831a3ead69d58ca3d58559654ea06d2;p=p5sagit%2Fp5-mst-13.2.git regcomp.c, t/op/regmesg.t -- False range with \p and \P Message-ID: p4raw-id: //depot/perl@22995 --- diff --git a/regcomp.c b/regcomp.c index 68fe68c..5388495 100644 --- a/regcomp.c +++ b/regcomp.c @@ -3661,7 +3661,8 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state) } RExC_parse = e + 1; ANYOF_FLAGS(ret) |= ANYOF_UNICODE; - continue; + namedclass = ANYOF_MAX; /* no official name, but it's named */ + break; case 'n': value = '\n'; break; case 'r': value = '\r'; break; case 't': value = '\t'; break; @@ -4066,6 +4067,9 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state) } Perl_sv_catpvf(aTHX_ listsv, "!utf8::IsXDigit\n"); break; + case ANYOF_MAX: + /* this is to handle \p and \P */ + break; default: vFAIL("Invalid [::] class"); break; diff --git a/t/op/regmesg.t b/t/op/regmesg.t index 05688b4..1b613ed 100644 --- a/t/op/regmesg.t +++ b/t/op/regmesg.t @@ -98,6 +98,8 @@ my @death = 'm/[a-\d]/' => 'False [] range "a-\d" in regex; marked by {#} in m/[a-\d{#}]/', 'm/[\w-x]/' => 'False [] range "\w-" in regex; marked by {#} in m/[\w-{#}x]/', + 'm/[a-\pM]/' => 'False [] range "a-\pM" in regex; marked by {#} in m/[a-\pM{#}]/', + 'm/[\pM-x]/' => 'False [] range "\pM-" in regex; marked by {#} in m/[\pM-{#}x]/', "m'\\y'" => 'Unrecognized escape \y passed through in regex; marked by {#} in m/\y{#}/', );