From a96df643850d22bc4a943802c3dd142af0ab0057 Mon Sep 17 00:00:00 2001 From: Father Chrysostomos Date: Wed, 6 Nov 2013 16:18:48 -0800 Subject: 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. --- keywords.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'keywords.c') 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: */ -- cgit v1.2.1