diff options
author | Karl Williamson <khw@khw-desktop.(none)> | 2010-06-24 08:21:27 -0600 |
---|---|---|
committer | David Golden <dagolden@cpan.org> | 2010-07-17 21:50:48 -0400 |
commit | fa1639c581be6a27f090adf217f82a3e86ba3446 (patch) | |
tree | ce9274ff749c07475863a10b0f5b5a65d531a84f | |
parent | 9d8606788fa6ee1bda9ff32c9ae6693c93631733 (diff) | |
download | perl-fa1639c581be6a27f090adf217f82a3e86ba3446.tar.gz |
\400 -\777 now means the same thing in all d-quote
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>
-rw-r--r-- | pod/perl5133delta.pod | 10 | ||||
-rw-r--r-- | pod/perldiag.pod | 9 | ||||
-rw-r--r-- | pod/perlrebackslash.pod | 2 | ||||
-rw-r--r-- | regcomp.c | 13 | ||||
-rw-r--r-- | t/re/pat_rt_report.t | 11 | ||||
-rw-r--r-- | t/re/re_tests | 7 |
6 files changed, 21 insertions, 31 deletions
diff --git a/pod/perl5133delta.pod b/pod/perl5133delta.pod index 049a78f7d2..476427e025 100644 --- a/pod/perl5133delta.pod +++ b/pod/perl5133delta.pod @@ -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 ] +=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. diff --git a/pod/perldiag.pod b/pod/perldiag.pod index 26c35a0c30..9e8a28735c 100644 --- a/pod/perldiag.pod +++ b/pod/perldiag.pod @@ -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';>. -=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 diff --git a/pod/perlrebackslash.pod b/pod/perlrebackslash.pod index 5728e7d05a..cfd9a6f6d8 100644 --- a/pod/perlrebackslash.pod +++ b/pod/perlrebackslash.pod @@ -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 -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 @@ -7500,17 +7500,8 @@ tryagain: 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; } diff --git a/t/re/pat_rt_report.t b/t/re/pat_rt_report.t index efbbe8f2fd..33b6f7c8aa 100644 --- a/t/re/pat_rt_report.t +++ b/t/re/pat_rt_report.t @@ -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; @@ -1053,15 +1053,6 @@ sub run_tests { 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; diff --git a/t/re/re_tests b/t/re/re_tests index 1950bdf129..fc29fb6bd5 100644 --- a/t/re/re_tests +++ b/t/re/re_tests @@ -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 +\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 |