In perl.git, the branch sprout/lexsub has been updated <http://perl5.git.perl.org/perl.git/commitdiff/71eee7327ed8968dd2776b7471e1e24646637e8e?hp=c60deeb444ee731a2c7ef908f7e1c29236889186>
- Log ----------------------------------------------------------------- commit 71eee7327ed8968dd2776b7471e1e24646637e8e Author: Father Chrysostomos <[email protected]> Date: Thu Sep 6 22:57:50 2012 -0700 Donât mention pkg in proto warnings for lex subs ----------------------------------------------------------------------- Summary of changes: t/lib/warnings/toke | 14 ++++++++++++++ toke.c | 7 +++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/t/lib/warnings/toke b/t/lib/warnings/toke index e436cec..c07fa95 100644 --- a/t/lib/warnings/toke +++ b/t/lib/warnings/toke @@ -1145,6 +1145,14 @@ sub underscore_last_pos($_); sub underscore2($_;$); sub underscore_fail($_$); sub underscore_after_at(@_); +our sub hour (@$); +my sub migh (@$); +use 5.01; +state sub estate (@$); +package other; +sub hour (@$); +sub migh (@$); +sub estate (@$); no warnings "syntax"; sub proto_after_array(@$); sub proto_after_hash(%$); @@ -1154,6 +1162,12 @@ Prototype after '@' for main::proto_after_array : @$ at - line 3. Prototype after '%' for main::proto_after_hash : %$ at - line 7. Illegal character after '_' in prototype for main::underscore_fail : $_$ at - line 12. Prototype after '@' for main::underscore_after_at : @_ at - line 13. +Prototype after '@' for hour : @$ at - line 14. +Prototype after '@' for migh : @$ at - line 15. +Prototype after '@' for estate : @$ at - line 17. +Prototype after '@' for hour : @$ at - line 19. +Prototype after '@' for migh : @$ at - line 20. +Prototype after '@' for estate : @$ at - line 21. ######## # toke.c use warnings "ambiguous"; diff --git a/toke.c b/toke.c index 90be0cf..795c29c 100644 --- a/toke.c +++ b/toke.c @@ -8281,7 +8281,11 @@ Perl_yylex(pTHX) if (PL_madskills) nametoke = newSVpvn_flags(s, d - s, SvUTF8(PL_linestr)); #endif - if (memchr(tmpbuf, ':', len) || key == KEY_our) + *PL_tokenbuf = '&'; + if (memchr(tmpbuf, ':', len) || key != KEY_sub + || pad_findmy_pvn( + PL_tokenbuf, len + 1, UTF ? SVf_UTF8 : 0 + ) != NOT_IN_PAD) sv_setpvn(PL_subname, tmpbuf, len); else { sv_setsv(PL_subname,PL_curstname); @@ -8292,7 +8296,6 @@ Perl_yylex(pTHX) SvUTF8_on(PL_subname); have_name = TRUE; - *PL_tokenbuf = '&'; #ifdef PERL_MAD start_force(0); -- Perl5 Master Repository
