diff options
author | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2008-06-08 09:12:01 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2008-06-08 09:12:01 +0000 |
commit | aef2a98a19b5e1de02b2dac2bc5531eec0da8634 (patch) | |
tree | 9429738b58c42cd20537938eaae6d44b8f962e0c /toke.c | |
parent | 327323c1441f5da6b2f948a9c72f807c73101435 (diff) | |
download | perl-aef2a98a19b5e1de02b2dac2bc5531eec0da8634.tar.gz |
Tweak the "Illegal character in prototype" warning so it's more
precise when reporting illegal characters after _
p4raw-id: //depot/perl@34023
Diffstat (limited to 'toke.c')
-rw-r--r-- | toke.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -6749,6 +6749,7 @@ Perl_yylex(pTHX) 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 @@ Perl_yylex(pTHX) greedy_proto = *p; } else if ( *p == '_' ) { - underscore = TRUE; + underscore = seen_underscore = TRUE; } } } @@ -6799,7 +6800,8 @@ Perl_yylex(pTHX) 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; |