This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Stop lexical CORE sub from interfering with CORE::
authorFather Chrysostomos <sprout@cpan.org>
Thu, 7 Nov 2013 00:18:48 +0000 (16:18 -0800)
committerFather Chrysostomos <sprout@cpan.org>
Fri, 8 Nov 2013 16:15:58 +0000 (08:15 -0800)
commita96df643850d22bc4a943802c3dd142af0ab0057
tree7cca2d887dc94f0f37c857d60f0e207f167e98aa
parent466112bb8d1a607f81f127e9641f40ce1164c3e7
Stop lexical CORE sub from interfering with CORE::

The way CORE:: was handled in the lexer was convoluted.

CORE was treated initially as a keyword, with exceptions in the lexer
to make it behave correctly.  If it turned out not to be followed
by ::, then the lexer would fall back to treating it as a bareword
or sub name.

Before even checking for a keyword, the lexer looks for :: and goes
to the bareword/sub code.  But it made a special exception there
for CORE::.

In the end, treating CORE as a keyword recognized by the keyword()
function requires more special cases than simply special-casing CORE::
in toke.c.

This fixes the lexical CORE sub bug, while reducing the total num-
ber of lines.
gv.c
keywords.c
keywords.h
op.c
pp.c
regen/keywords.pl
t/op/lexsub.t
toke.c