This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
\400 -\777 now means the same thing in all d-quote
authorKarl Williamson <khw@khw-desktop.(none)>
Thu, 24 Jun 2010 14:21:27 +0000 (08:21 -0600)
committerDavid Golden <dagolden@cpan.org>
Sun, 18 Jul 2010 01:50:48 +0000 (21:50 -0400)
Prior to this patch, \400 - \777 meant something different in some
circumstances in regexes outside bracketed character classes.  A
deprecated warning message has been in place since 5.10.1 when this
happens.  Remove the warning, and bring the behavior into line with the
other double-quotish contexts.  \400 - \777 now always means the same
thing as \x{100} - \x{1FF} (except when the octal forms  are taken as
backreferences.)

Signed-off-by: David Golden <dagolden@cpan.org>
pod/perl5133delta.pod
pod/perldiag.pod
pod/perlrebackslash.pod
regcomp.c
t/re/pat_rt_report.t
t/re/re_tests

index 049a78f..476427e 100644 (file)
@@ -76,6 +76,16 @@ XXX For a release on a stable branch, this section aspires to be:
 
 [ List each incompatible change as a =head2 entry ]
 
 
 [ List each incompatible change as a =head2 entry ]
 
+=head2 \400 - \777
+
+Use of C<\400> - C<\777> in regexes in certain circumstances has given different,
+anomalous behavior than their use in all other double-quotish contexts.   Since
+5.10.1, a deprecated warning message has been raised when this happens.  Now,
+all double-quotish contexts have the same behavior, namely to be equivalent to
+C<\x{100}> - C<\x{1FF}>, with no deprecation warning. Use of these values in the
+command line option C<"-0"> retains the current meaning to slurp input files
+whole; previously, this was documented only for C<"-0777">.
+
 =head1 Deprecations
 
 XXX Any deprecated features, syntax, modules etc. should be listed here.
 =head1 Deprecations
 
 XXX Any deprecated features, syntax, modules etc. should be listed here.
index 26c35a0..9e8a287 100644 (file)
@@ -4961,15 +4961,6 @@ In code that currently says C<use AutoLoader; @ISA = qw(AutoLoader);>
 you should remove AutoLoader from @ISA and change C<use AutoLoader;> to
 C<use AutoLoader 'AUTOLOAD';>.
 
 you should remove AutoLoader from @ISA and change C<use AutoLoader;> to
 C<use AutoLoader 'AUTOLOAD';>.
 
-=item Use of octal value above 377 is deprecated
-
-(D deprecated, W regexp) There is a constant in the regular expression whose
-value is interpeted by Perl as octal and larger than 377 (255 decimal, 0xFF
-hex).  Perl may take this to mean different things depending on the rest of
-the regular expression.  If you meant such an octal value, convert it to
-hexadecimal and use C<\xHH> or C<\x{HH}> instead.  If you meant to have
-part of it mean a backreference, use C<\g> for that.  See L<perlre>.
-
 =item Use of %s in printf format not supported
 
 (F) You attempted to use a feature of printf that is accessible from
 =item Use of %s in printf format not supported
 
 (F) You attempted to use a feature of printf that is accessible from
index 5728e7d..cfd9a6f 100644 (file)
@@ -211,7 +211,7 @@ Octal escapes consist of a backslash followed by three octal digits
 matching the code point of the character you want to use.  (In some contexts,
 two or even one octal digits are also accepted, sometimes with a warning.) This
 allows for 512 characters (C<\000> up to C<\777>) that can be expressed this
 matching the code point of the character you want to use.  (In some contexts,
 two or even one octal digits are also accepted, sometimes with a warning.) This
 allows for 512 characters (C<\000> up to C<\777>) that can be expressed this
-way (but anything above C<\377> is deprecated).  Enough in pre-Unicode days,
+way.  Enough in pre-Unicode days,
 but most Unicode characters cannot be escaped this way.
 
 Note that a character that is expressed as an octal escape is considered
 but most Unicode characters cannot be escaped this way.
 
 Note that a character that is expressed as an octal escape is considered
index 49651b2..72af569 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -7500,17 +7500,8 @@ tryagain:
                             I32 flags = 0;
                            STRLEN numlen = 3;
                            ender = grok_oct(p, &numlen, &flags, NULL);
                             I32 flags = 0;
                            STRLEN numlen = 3;
                            ender = grok_oct(p, &numlen, &flags, NULL);
-
-                           /* An octal above 0xff is interpreted differently
-                            * depending on if the re is in utf8 or not.  If it
-                            * is in utf8, the value will be itself, otherwise
-                            * it is interpreted as modulo 0x100.  It has been
-                            * decided to discourage the use of octal above the
-                            * single-byte range.  For now, warn only when
-                            * it ends up modulo */
-                           if (SIZE_ONLY && ender >= 0x100
-                                   && ! UTF && ! PL_encoding) {
-                               ckWARNregdep(p, "Use of octal value above 377 is deprecated");
+                           if (ender > 0xff) {
+                               RExC_utf8 = 1;
                            }
                            p += numlen;
                        }
                            }
                            p += numlen;
                        }
index efbbe8f..33b6f7c 100644 (file)
@@ -21,7 +21,7 @@ BEGIN {
 }
 
 
 }
 
 
-plan tests => 2511;  # Update this when adding/deleting tests.
+plan tests => 2510;  # Update this when adding/deleting tests.
 
 run_tests() unless caller;
 
 
 run_tests() unless caller;
 
@@ -1053,15 +1053,6 @@ sub run_tests {
         iseq $te [0], '../';
     }
 
         iseq $te [0], '../';
     }
 
-       # This currently has to come before any "use encoding" in this file.
-    {
-        local $Message;
-        local $BugId   = '59342';
-        must_warn 'qr/\400/', '^Use of octal value above 377';
-    }
-
-
-
     {
         local $BugId =  '60034';
         my $a = "xyzt" x 8192;
     {
         local $BugId =  '60034';
         my $a = "xyzt" x 8192;
index 1950bdf..fc29fb6 100644 (file)
@@ -1454,4 +1454,11 @@ abc\N{def        -       c       -       \\N{NAME} must be resolved by the lexer
 \c1    -       c       -       \"\\c1\" more clearly written simply as \"q\"
 \cA    \001    y       $&      \1
 
 \c1    -       c       -       \"\\c1\" more clearly written simply as \"q\"
 \cA    \001    y       $&      \1
 
+\400   \x{100} y       $&      \x{100}
+\600   \x{180} y       $&      \x{180}
+\777   \x{1FF} y       $&      \x{1FF}
+[a\400]        \x{100} y       $&      \x{100}
+[b\600]        \x{180} y       $&      \x{180}
+[c\777]        \x{1FF} y       $&      \x{1FF}
+
 # vim: softtabstop=0 noexpandtab
 # vim: softtabstop=0 noexpandtab