summaryrefslogtreecommitdiff
path: root/keywords.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2013-11-06 16:18:48 -0800
committerFather Chrysostomos <sprout@cpan.org>2013-11-08 08:15:58 -0800
commita96df643850d22bc4a943802c3dd142af0ab0057 (patch)
tree7cca2d887dc94f0f37c857d60f0e207f167e98aa /keywords.c
parent466112bb8d1a607f81f127e9641f40ce1164c3e7 (diff)
downloadperl-a96df643850d22bc4a943802c3dd142af0ab0057.tar.gz
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.
Diffstat (limited to 'keywords.c')
-rw-r--r--keywords.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/keywords.c b/keywords.c
index 23d550df83..cd8a99ea2e 100644
--- a/keywords.c
+++ b/keywords.c
@@ -490,19 +490,9 @@ Perl_keyword (pTHX_ const char *name, I32 len, bool all_keywords)
goto unknown;
}
- case 4: /* 41 tokens of length 4 */
+ case 4: /* 40 tokens of length 4 */
switch (name[0])
{
- case 'C':
- if (name[1] == 'O' &&
- name[2] == 'R' &&
- name[3] == 'E')
- { /* CORE */
- return -KEY_CORE;
- }
-
- goto unknown;
-
case 'I':
if (name[1] == 'N' &&
name[2] == 'I' &&
@@ -3449,5 +3439,5 @@ unknown:
}
/* Generated from:
- * e5a540774760ea54c761ef17ee4a153cc264e9a700b817d561e390730c457406 regen/keywords.pl
+ * 7c6d47fd2890b2422a40331ec90eac08f9808209b01f2b9c113141410fea91b5 regen/keywords.pl
* ex: set ro: */