This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[perl #113016] Parse CORE::foo::bar as a bareword
authorFather Chrysostomos <sprout@cpan.org>
Sat, 7 Jul 2012 04:57:39 +0000 (21:57 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Sat, 7 Jul 2012 05:26:33 +0000 (22:26 -0700)
commitee36fb64514b5be225fa71afa0a6fb4414e469b1
treec56f4a8c88d69c530eb12d76da4a7d79b50635e2
parent39c012bc2fc2f1cf310f6d4ba499ec58a7bad900
[perl #113016] Parse CORE::foo::bar as a bareword

CORE::print::foo was being parsed as CORE::print followed by
::foo, making it impossible to call a global override directly as
CORE::GLOBAL::uc().

The logic in toke.c that does the CORE:: special-casing was faulty.
This commit fixes it, by checking for a package separator after the
potential keyword.

That d = s part of the KEY_CORE case in yylex was added in perl 5.001
(748a9306) but apparently wasn’t doing anything.  That means I get to
move it before s+=2, now that I have a use for it.

I added the tests a little above the ‘Add new tests HERE’ label in
parser.t, to avoid conflicting with other patches I’m working on.
t/comp/parser.t
toke.c