you're twisted enough, you can change C<"\N{LATIN CAPITAL LETTER A}"> to
mean C<"B">, etc.
-Note that an alias should not be something that is a legal curly
-brace-enclosed quantifier (see L<perlreref/QUANTIFIERS>). For example
-C<\N{123}> means to match 123 non-newline characters, and is not treated as a
-charnames alias. Aliases are discouraged from beginning with anything
-other than an alphabetic character and from containing anything other
-than alphanumerics, spaces, dashes, parentheses, and underscores.
-Currently they must be Latin1.
+Aliases may not begin with anything other than an alphabetic character nor
+contain anything other than alphanumerics, spaces, dashes, parentheses, and
+underscores. Currently they must be Latin1.
An alias can map to either an official Unicode character name (not a loose
matched name) or to a
a stand-in for some unknown character, any code that has this problem is
buggy.
+=head2 Formerly deprecated characters in C<\N{}> character name aliases are now errors.
+
+Since v5.12.0, it has been deprecated to use certain characters in
+user-defined C<\N{...}> character names. These now cause a syntax
+error. For example, it is now an error to begin a name with a digit,
+such as in
+
+ my $undraftable = "\N{4F}"; # Syntax error!
+
+or to have commas anywhere in the name. See L<charnames/CUSTOM ALIASES>
+
=head1 Deprecations
XXX Any deprecated features, syntax, modules etc. should be listed here. In
long for Perl to handle. You have to be seriously twisted to write code
that triggers this error.
-=item Deprecated character in \N{...}; marked by <-- HERE in \N{%s<-- HERE %s
-
-(D deprecated) Just about anything is legal for the C<...> in C<\N{...}>.
-But starting in 5.12, non-reasonable ones that don't look like names
-are deprecated. A reasonable name begins with an alphabetic character
-and continues with any combination of alphanumerics, dashes, spaces,
-parentheses or colons.
-
=item Deprecated use of my() in false conditional
(D deprecated) You used a declaration similar to C<my $x if 0>. There
(F) The indicated attributes for a subroutine or variable were not
recognized by Perl or by a user-supplied handler. See L<attributes>.
+=item Invalid character in \N{...}; marked by <-- HERE in \N{%s}
+
+(F) Only certain characters are valid for character names. The
+indicated one isn't. See L<charnames/CUSTOM ALIASES>.
+
=item Invalid conversion in %s: "%s"
(W printf) Perl does not understand the given format conversion. See
eval q [ok "\N{TOO-LONG-STR}" =~ /^\N{TOO-LONG-STR}$/, 'Verify that what once was too long a string works'];
eval 'q(syntax error) =~ /\N{MALFORMED}/';
ok $@ && $@ =~ /Malformed/, 'Verify that malformed utf8 gives an error';
- undef $w;
eval 'q() =~ /\N{4F}/';
- ok $w && $w =~ /Deprecated/, 'Verify that leading digit in name gives warning';
- undef $w;
+ ok $@ && $@ =~ /Invalid character/, 'Verify that leading digit in name gives error';
eval 'q() =~ /\N{COM,MA}/';
- ok $w && $w =~ /Deprecated/, 'Verify that comma in name gives warning';
- undef $w;
+ ok $@ && $@ =~ /Invalid character/, 'Verify that comma in name gives error';
my $name = "A\x{D7}O";
eval "q(W) =~ /\\N{$name}/";
- ok $w && $w =~ /Deprecated/, 'Verify that latin1 symbol in name gives warning';
+ ok $@ && $@ =~ /Invalid character/, 'Verify that latin1 symbol in name gives error';
undef $w;
$name = "A\x{D1}O";
eval "q(W) =~ /\\N{$name}/";
return NULL;
}
- /* Deprecate non-approved name syntax */
- if (ckWARN_d(WARN_DEPRECATED)) {
+ {
bool problematic = FALSE;
const char* i = s;
/* The e-i passed to the final %.*s makes sure that should the
* trailing NUL be missing that this print won't run off the end of
* the string */
- Perl_warner(aTHX_ packWARN(WARN_DEPRECATED),
- "Deprecated character in \\N{...}; marked by <-- HERE in \\N{%.*s<-- HERE %.*s",
- (int)(i - s + 1), s, (int)(e - i), i + 1);
+ yyerror(Perl_form(aTHX_
+ "Invalid character in \\N{...}; marked by <-- HERE in \\N{%.*s<-- HERE %.*s",
+ (int)(i - s + 1), s, (int)(e - i), i + 1));
+ return NULL;
}
}