diff options
author | Karl Williamson <khw@cpan.org> | 2016-03-28 21:04:40 -0600 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2016-05-09 09:16:34 -0600 |
commit | 61463a3eba401750124ace520c1bd60db4301a84 (patch) | |
tree | 12c737f77f31d500c76803cd58f49f5ae51bc871 | |
parent | fe427a6378fe383fb343e07edbe0afaf4c9a18e0 (diff) | |
download | perl-61463a3eba401750124ace520c1bd60db4301a84.tar.gz |
Stop accepting deprecated NBSP in \N{}
As scheduled for 5.26, this construct will no longer be accepted.
-rw-r--r-- | charclass_invlists.h | 2 | ||||
-rw-r--r-- | l1_char_class_tab.h | 6 | ||||
-rw-r--r-- | lib/_charnames.pm | 9 | ||||
-rw-r--r-- | lib/charnames.pm | 2 | ||||
-rw-r--r-- | lib/unicore/mktables | 1 | ||||
-rw-r--r-- | pod/perldelta.pod | 9 | ||||
-rw-r--r-- | pod/perldiag.pod | 8 | ||||
-rw-r--r-- | regcharclass.h | 2 | ||||
-rw-r--r-- | t/lib/charnames/alias | 10 | ||||
-rw-r--r-- | t/re/pat_advanced.t | 36 | ||||
-rw-r--r-- | toke.c | 13 |
11 files changed, 16 insertions, 82 deletions
diff --git a/charclass_invlists.h b/charclass_invlists.h index 50ac8e3424..629c066c20 100644 --- a/charclass_invlists.h +++ b/charclass_invlists.h @@ -87887,7 +87887,7 @@ static const U8 WB_table[19][19] = { * 1a0687fb9c6c4567e853913549df0944fe40821279a3e9cdaa6ab8679bc286fd lib/unicore/extracted/DLineBreak.txt * 40bcfed3ca727c19e1331f6c33806231d5f7eeeabd2e6a9e06a3740c85d0c250 lib/unicore/extracted/DNumType.txt * a18d502bad39d527ac5586d7bc93e29f565859e3bcc24ada627eff606d6f5fed lib/unicore/extracted/DNumValues.txt - * a054c7cdbdc57cf0a8ffb16b0b4944800df23fd6d76fc3c46ba58c5d2b38baf0 lib/unicore/mktables + * 718d6ea8b96ee3d12c9c3a48ceb0f5cebe023634002ac8b2ede12b306273aa52 lib/unicore/mktables * 462c9aaa608fb2014cd9649af1c5c009485c60b9c8b15b89401fdc10cf6161c6 lib/unicore/version * 913d2f93f3cb6cdf1664db888bf840bc4eb074eef824e082fceda24a9445e60c regen/charset_translations.pl * 12bd58cb9d5a99f631ca95e269f7f9c90dacaf81020efa5d95a995f3cdc19200 regen/mk_invlists.pl diff --git a/l1_char_class_tab.h b/l1_char_class_tab.h index 7602a781b7..df736642f7 100644 --- a/l1_char_class_tab.h +++ b/l1_char_class_tab.h @@ -168,7 +168,7 @@ /* U+9D OSC */ (1U<<_CC_CNTRL)|(1U<<_CC_QUOTEMETA), /* U+9E PM */ (1U<<_CC_CNTRL)|(1U<<_CC_QUOTEMETA), /* U+9F APC */ (1U<<_CC_CNTRL)|(1U<<_CC_QUOTEMETA), -/* U+A0 NBSP */ (1U<<_CC_BLANK)|(1U<<_CC_CHARNAME_CONT)|(1U<<_CC_PRINT)|(1U<<_CC_QUOTEMETA)|(1U<<_CC_SPACE), +/* U+A0 NBSP */ (1U<<_CC_BLANK)|(1U<<_CC_PRINT)|(1U<<_CC_QUOTEMETA)|(1U<<_CC_SPACE), /* U+A1 INVERTED '!' */ (1U<<_CC_GRAPH)|(1U<<_CC_PRINT)|(1U<<_CC_PUNCT)|(1U<<_CC_QUOTEMETA), /* U+A2 CENT */ (1U<<_CC_GRAPH)|(1U<<_CC_PRINT)|(1U<<_CC_QUOTEMETA), /* U+A3 POUND */ (1U<<_CC_GRAPH)|(1U<<_CC_PRINT)|(1U<<_CC_QUOTEMETA), @@ -336,7 +336,7 @@ /* 0x3E U+9E PM */ (1U<<_CC_CNTRL)|(1U<<_CC_QUOTEMETA), /* 0x3F U+1A SUB */ (1U<<_CC_ASCII)|(1U<<_CC_CNTRL)|(1U<<_CC_QUOTEMETA), /* 0x40 U+20 SP */ (1U<<_CC_ASCII)|(1U<<_CC_BLANK)|(1U<<_CC_CHARNAME_CONT)|(1U<<_CC_PRINT)|(1U<<_CC_QUOTEMETA)|(1U<<_CC_SPACE), -/* 0x41 U+A0 NBSP */ (1U<<_CC_BLANK)|(1U<<_CC_CHARNAME_CONT)|(1U<<_CC_PRINT)|(1U<<_CC_QUOTEMETA)|(1U<<_CC_SPACE)|(1U<<_CC_UTF8_IS_CONTINUATION), +/* 0x41 U+A0 NBSP */ (1U<<_CC_BLANK)|(1U<<_CC_PRINT)|(1U<<_CC_QUOTEMETA)|(1U<<_CC_SPACE)|(1U<<_CC_UTF8_IS_CONTINUATION), /* 0x42 U+E2 I8=A1 a with '^' */ (1U<<_CC_ALPHANUMERIC)|(1U<<_CC_ALPHA)|(1U<<_CC_CASED)|(1U<<_CC_CHARNAME_CONT)|(1U<<_CC_GRAPH)|(1U<<_CC_IDFIRST)|(1U<<_CC_LOWER)|(1U<<_CC_PRINT)|(1U<<_CC_WORDCHAR)|(1U<<_CC_IS_IN_SOME_FOLD)|(1U<<_CC_UTF8_IS_CONTINUATION), /* 0x43 U+E4 I8=A2 a with diaeresis */ (1U<<_CC_ALPHANUMERIC)|(1U<<_CC_ALPHA)|(1U<<_CC_CASED)|(1U<<_CC_CHARNAME_CONT)|(1U<<_CC_GRAPH)|(1U<<_CC_IDFIRST)|(1U<<_CC_LOWER)|(1U<<_CC_PRINT)|(1U<<_CC_WORDCHAR)|(1U<<_CC_IS_IN_SOME_FOLD)|(1U<<_CC_UTF8_IS_CONTINUATION), /* 0x44 U+E0 I8=A3 a with grave */ (1U<<_CC_ALPHANUMERIC)|(1U<<_CC_ALPHA)|(1U<<_CC_CASED)|(1U<<_CC_CHARNAME_CONT)|(1U<<_CC_GRAPH)|(1U<<_CC_IDFIRST)|(1U<<_CC_LOWER)|(1U<<_CC_PRINT)|(1U<<_CC_WORDCHAR)|(1U<<_CC_IS_IN_SOME_FOLD)|(1U<<_CC_UTF8_IS_CONTINUATION), @@ -599,7 +599,7 @@ /* 0x3E U+9E PM */ (1U<<_CC_CNTRL)|(1U<<_CC_QUOTEMETA), /* 0x3F U+1A SUB */ (1U<<_CC_ASCII)|(1U<<_CC_CNTRL)|(1U<<_CC_QUOTEMETA), /* 0x40 U+20 SP */ (1U<<_CC_ASCII)|(1U<<_CC_BLANK)|(1U<<_CC_CHARNAME_CONT)|(1U<<_CC_PRINT)|(1U<<_CC_QUOTEMETA)|(1U<<_CC_SPACE), -/* 0x41 U+A0 NBSP */ (1U<<_CC_BLANK)|(1U<<_CC_CHARNAME_CONT)|(1U<<_CC_PRINT)|(1U<<_CC_QUOTEMETA)|(1U<<_CC_SPACE)|(1U<<_CC_UTF8_IS_CONTINUATION), +/* 0x41 U+A0 NBSP */ (1U<<_CC_BLANK)|(1U<<_CC_PRINT)|(1U<<_CC_QUOTEMETA)|(1U<<_CC_SPACE)|(1U<<_CC_UTF8_IS_CONTINUATION), /* 0x42 U+E2 I8=A1 a with '^' */ (1U<<_CC_ALPHANUMERIC)|(1U<<_CC_ALPHA)|(1U<<_CC_CASED)|(1U<<_CC_CHARNAME_CONT)|(1U<<_CC_GRAPH)|(1U<<_CC_IDFIRST)|(1U<<_CC_LOWER)|(1U<<_CC_PRINT)|(1U<<_CC_WORDCHAR)|(1U<<_CC_IS_IN_SOME_FOLD)|(1U<<_CC_UTF8_IS_CONTINUATION), /* 0x43 U+E4 I8=A2 a with diaeresis */ (1U<<_CC_ALPHANUMERIC)|(1U<<_CC_ALPHA)|(1U<<_CC_CASED)|(1U<<_CC_CHARNAME_CONT)|(1U<<_CC_GRAPH)|(1U<<_CC_IDFIRST)|(1U<<_CC_LOWER)|(1U<<_CC_PRINT)|(1U<<_CC_WORDCHAR)|(1U<<_CC_IS_IN_SOME_FOLD)|(1U<<_CC_UTF8_IS_CONTINUATION), /* 0x44 U+E0 I8=A3 a with grave */ (1U<<_CC_ALPHANUMERIC)|(1U<<_CC_ALPHA)|(1U<<_CC_CASED)|(1U<<_CC_CHARNAME_CONT)|(1U<<_CC_GRAPH)|(1U<<_CC_IDFIRST)|(1U<<_CC_LOWER)|(1U<<_CC_PRINT)|(1U<<_CC_WORDCHAR)|(1U<<_CC_IS_IN_SOME_FOLD)|(1U<<_CC_UTF8_IS_CONTINUATION), diff --git a/lib/_charnames.pm b/lib/_charnames.pm index bb7d7c6c7b..50fdd85c5d 100644 --- a/lib/_charnames.pm +++ b/lib/_charnames.pm @@ -6,7 +6,7 @@ package _charnames; use strict; use warnings; -our $VERSION = '1.43'; +our $VERSION = '1.44'; use unicore::Name; # mktables-generated algorithmically-defined names use bytes (); # for $bytes::hint_bits @@ -202,13 +202,6 @@ sub alias (@) # Set up a single alias } $^H{charnames_name_aliases}{$name} = $value; - if (warnings::enabled('deprecated') - && $name =~ / ( .* $nbsp ) ( .* ) $ /x) - { - carp "NO-BREAK SPACE in a charnames alias definition is " - . "deprecated; marked by <-- HERE in '$1 <-- HERE " - . $2 . "'"; - } } } } diff --git a/lib/charnames.pm b/lib/charnames.pm index 2efe3d58b2..a0f3227f4d 100644 --- a/lib/charnames.pm +++ b/lib/charnames.pm @@ -1,7 +1,7 @@ package charnames; use strict; use warnings; -our $VERSION = '1.43'; +our $VERSION = '1.44'; use unicore::Name; # mktables-generated algorithmically-defined names use _charnames (); # The submodule for this where most of the work gets done diff --git a/lib/unicore/mktables b/lib/unicore/mktables index 9efc759f7f..bea8739418 100644 --- a/lib/unicore/mktables +++ b/lib/unicore/mktables @@ -14865,7 +14865,6 @@ sub compile_perl() { + ord("(") + ord(")") + ord("-") - + utf8::unicode_to_native(0xA0) # NBSP ); my @composition = ('Name', 'Unicode_1_Name', '_Perl_Name_Alias'); diff --git a/pod/perldelta.pod b/pod/perldelta.pod index 3c19b1f99e..c0dbcabfa4 100644 --- a/pod/perldelta.pod +++ b/pod/perldelta.pod @@ -34,13 +34,10 @@ L</Selected Bug Fixes> section. =head1 Incompatible Changes -XXX For a release on a stable branch, this section aspires to be: +=head2 C<NBSP> is no longer permissible in C<\N{...}> - There are no changes intentionally incompatible with 5.XXX.XXX - If any exist, they are bugs, and we request that you submit a - report. See L</Reporting Bugs> below. - -[ List each incompatible change as a =head2 entry ] +The name of a character may no longer contain non-breaking spaces. It +has been deprecated to do so since Perl v5.22. =head1 Deprecations diff --git a/pod/perldiag.pod b/pod/perldiag.pod index 78aeb164e3..ea0d21eafb 100644 --- a/pod/perldiag.pod +++ b/pod/perldiag.pod @@ -3784,14 +3784,6 @@ setgid script to even be allowed to attempt. Generally speaking there will be another way to do what you want that is, if not secure, at least securable. See L<perlsec>. -=item NO-BREAK SPACE in a charnames alias definition is deprecated - -(D deprecated) You defined a character name which contained a no-break -space character. Change it to a regular space. Usually these names are -defined in the C<:alias> import argument to C<use charnames>, but they -could be defined by a translator installed into C<$^H{charnames}>. See -L<charnames/CUSTOM ALIASES>. - =item No code specified for -%c (F) Perl's B<-e> and B<-E> command-line options require an argument. If diff --git a/regcharclass.h b/regcharclass.h index 08f3dbf71b..ac5f239082 100644 --- a/regcharclass.h +++ b/regcharclass.h @@ -1895,7 +1895,7 @@ * 1a0687fb9c6c4567e853913549df0944fe40821279a3e9cdaa6ab8679bc286fd lib/unicore/extracted/DLineBreak.txt * 40bcfed3ca727c19e1331f6c33806231d5f7eeeabd2e6a9e06a3740c85d0c250 lib/unicore/extracted/DNumType.txt * a18d502bad39d527ac5586d7bc93e29f565859e3bcc24ada627eff606d6f5fed lib/unicore/extracted/DNumValues.txt - * a054c7cdbdc57cf0a8ffb16b0b4944800df23fd6d76fc3c46ba58c5d2b38baf0 lib/unicore/mktables + * 718d6ea8b96ee3d12c9c3a48ceb0f5cebe023634002ac8b2ede12b306273aa52 lib/unicore/mktables * 462c9aaa608fb2014cd9649af1c5c009485c60b9c8b15b89401fdc10cf6161c6 lib/unicore/version * 913d2f93f3cb6cdf1664db888bf840bc4eb074eef824e082fceda24a9445e60c regen/charset_translations.pl * d9c04ac46bdd81bb3e26519f2b8eb6242cb12337205add3f7cf092b0c58dccc4 regen/regcharclass.pl diff --git a/t/lib/charnames/alias b/t/lib/charnames/alias index 33ccff4232..c0b039f1f9 100644 --- a/t/lib/charnames/alias +++ b/t/lib/charnames/alias @@ -416,12 +416,6 @@ use utf8; use open qw( :utf8 :std ); use charnames ":alias" => { "NBSP SEPARATED SPACE" => "BLACK SMILING FACE" }; print "ok\n" if "\N{NBSP SEPARATED SPACE}" eq "\x{263B}"; -print "ok\n" if "\N{NBSP SEPARATED SPACE}" eq "\x{263B}"; -no warnings 'deprecated'; -print "ok\n" if "\N{NBSP SEPARATED SPACE}" eq "\x{263B}"; EXPECT -OPTIONS regex -NO-BREAK SPACE in a charnames alias definition is deprecated; marked by <-- HERE in 'NBSP SEPARATED <-- HERE SPACE' at - line \d+. -ok -ok -ok +OPTIONS regex fatal +Invalid character in charnames alias definition; marked by <-- HERE in 'NBSP <-- HERE SEPARATED SPACE' at - line 3 diff --git a/t/re/pat_advanced.t b/t/re/pat_advanced.t index 913e84662f..6e0b0dae76 100644 --- a/t/re/pat_advanced.t +++ b/t/re/pat_advanced.t @@ -986,41 +986,13 @@ sub run_tests { . "SPACE"; my $NBSP_utf8 = $NBSP_Latin1; utf8::upgrade($NBSP_utf8); - eval qq[is("\\N{$NBSP_Latin1}", "$NBSP_Latin1", "An NBSP in character name works")]; - like ($w, qr/NO-BREAK SPACE in a charnames alias definition is deprecated/, "... but returns a deprecation warning"); + () = eval qq[is("\\N{$NBSP_Latin1}", "$NBSP_Latin1"]; + like ($@, qr/Invalid character in \\N\{...}/, "A NO-BREAK SPACE in a charnames alias is fatal"); undef $w; { use feature 'unicode_eval'; - eval qq[use utf8; is("\\N{$NBSP_utf8}", "$NBSP_utf8", "Same under 'use utf8': they work")]; - like ($w, qr/NO-BREAK SPACE in a charnames alias definition is deprecated/, "... but return a deprecation warning"); - } - { - # disable lexical warnings - BEGIN { ${^WARNING_BITS} = undef; $^W = 0 } - undef $w; - () = eval qq["\\N{$NBSP_Latin1}"]; - like ($w, qr/NO-BREAK SPACE in a charnames alias definition is deprecated/, "And returns a deprecation warning outside of lexical warnings"); - undef $w; - use feature 'unicode_eval'; - eval qq[use utf8; () = "\\N{$NBSP_utf8}"]; - like ($w, qr/NO-BREAK SPACE in a charnames alias definition is deprecated/, "... same under utf8"); - } - { - no warnings 'deprecated'; - undef $w; - eval qq["\\N{$NBSP_Latin1}"]; - ok (! defined $w, "... and no warning if warnings are off"); - use feature 'unicode_eval'; - eval qq[use utf8; "\\N{$NBSP_utf8}"]; - ok (! defined $w, "... same under 'use utf8'"); - } - { - use warnings FATAL=>'deprecated'; - () = eval qq["\\N{$NBSP_Latin1}"]; - like ($@, qr/NO-BREAK SPACE in a charnames alias definition is deprecated/, "... the warning can be fatal"); - use feature 'unicode_eval'; - eval qq[use utf8; () = "\\N{$NBSP_utf8}"]; - like ($@, qr/NO-BREAK SPACE in a charnames alias definition is deprecated/, "... same under utf8"); + eval qq[use utf8; is("\\N{$NBSP_utf8}"]; + like ($@, qr/Invalid character in \\N\{...}/, "A NO-BREAK SPACE in a charnames alias is fatal"); } { @@ -2588,11 +2588,6 @@ S_get_and_check_backslash_N_name(pTHX_ const char* s, const char* const e) if (*s == ' ' && *(s-1) == ' ') { goto multi_spaces; } - if ((U8) *s == NBSP_NATIVE && ckWARN_d(WARN_DEPRECATED)) { - Perl_warner(aTHX_ packWARN(WARN_DEPRECATED), - "NO-BREAK SPACE in a charnames " - "alias definition is deprecated"); - } s++; } } @@ -2640,14 +2635,6 @@ S_get_and_check_backslash_N_name(pTHX_ const char* s, const char* const e) { goto bad_charname; } - if (*s == *NBSP_UTF8 - && *(s+1) == *(NBSP_UTF8+1) - && ckWARN_d(WARN_DEPRECATED)) - { - Perl_warner(aTHX_ packWARN(WARN_DEPRECATED), - "NO-BREAK SPACE in a charnames " - "alias definition is deprecated"); - } s += 2; } else { |