regcomp.c, t/op/regmesg.t -- False range with \p and \P
authorJeff Pinyan <japhy@pobox.com>
Thu, 24 Jun 2004 16:42:54 +0000 (12:42 -0400)
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Fri, 25 Jun 2004 15:07:51 +0000 (15:07 +0000)
Message-ID: <Pine.LNX.4.44.0406241636340.8774-200000@perlmonk.org>

p4raw-id: //depot/perl@22995

regcomp.c
t/op/regmesg.t

index 68fe68c..5388495 100644 (file)
--- 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;
index 05688b4..1b613ed 100644 (file)
@@ -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{#}/',
 );