develooper Front page | perl.perl5.porters | Postings from June 2004

[PATCH] regcomp.c, t/op/regmesg.t -- False range with \p and \P

Thread Next
From:
Jeff 'japhy' Pinyan
Date:
June 24, 2004 13:43
Subject:
[PATCH] regcomp.c, t/op/regmesg.t -- False range with \p and \P
Message ID:
Pine.LNX.4.44.0406241636340.8774-200000@perlmonk.org
--- regcomp.c.old	2004-06-24 16:11:59.000000000 -0400
+++ regcomp.c	2004-06-24 16:13:09.000000000 -0400
@@ -3661,7 +3661,8 @@
 		}
 		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 @@
 		    }
 		    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;


--- t/op/regmesg.t.old	2004-06-24 16:38:11.000000000 -0400
+++ t/op/regmesg.t	2004-06-24 16:38:47.000000000 -0400
@@ -98,6 +98,8 @@
 
     '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{#}/',
 );
 

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About