Change 34023 by [EMAIL PROTECTED] on 2008/06/08 09:12:01
Tweak the "Illegal character in prototype" warning so it's more
precise when reporting illegal characters after _
Affected files ...
... //depot/perl/t/lib/warnings/toke#22 edit
... //depot/perl/toke.c#825 edit
Differences ...
==== //depot/perl/t/lib/warnings/toke#22 (text) ====
Index: perl/t/lib/warnings/toke
--- perl/t/lib/warnings/toke#21~34021~ 2008-06-08 01:57:00.000000000 -0700
+++ perl/t/lib/warnings/toke 2008-06-08 02:12:01.000000000 -0700
@@ -873,5 +873,5 @@
EXPECT
Prototype after '@' for main::proto_after_array : @$ at - line 3.
Prototype after '%' for main::proto_after_hash : %$ at - line 7.
-Illegal character in prototype for main::underscore_fail : $_$ at - line 12.
+Illegal character after '_' in prototype for main::underscore_fail : $_$ at -
line 12.
Prototype after '@' for main::underscore_after_at : @_ at - line 13.
==== //depot/perl/toke.c#825 (text) ====
Index: perl/toke.c
--- perl/toke.c#824~34021~ 2008-06-08 01:57:00.000000000 -0700
+++ perl/toke.c 2008-06-08 02:12:01.000000000 -0700
@@ -6749,6 +6749,7 @@
bool proto_after_greedy_proto = FALSE;
bool must_be_last = FALSE;
bool underscore = FALSE;
+ bool seen_underscore = FALSE;
const bool warnsyntax = ckWARN(WARN_SYNTAX);
s = scan_str(s,!!PL_madskills,FALSE);
@@ -6786,7 +6787,7 @@
greedy_proto = *p;
}
else if ( *p == '_' ) {
- underscore = TRUE;
+ underscore = seen_underscore = TRUE;
}
}
}
@@ -6799,7 +6800,8 @@
greedy_proto, SVfARG(PL_subname), d);
if (bad_proto)
Perl_warner(aTHX_ packWARN(WARN_SYNTAX),
- "Illegal character in prototype for %"SVf"
: %s",
+ "Illegal character %sin prototype for
%"SVf" : %s",
+ seen_underscore ? "after '_' " : "",
SVfARG(PL_subname), d);
SvCUR_set(PL_lex_stuff, tmp);
have_proto = TRUE;
End of Patch.