diff options
author | Father Chrysostomos <sprout@cpan.org> | 2011-11-21 23:43:17 -0800 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2011-11-22 00:07:20 -0800 |
commit | 84ed01088568ffe9cf49047f10500ca511db0c9e (patch) | |
tree | 614defca700a49e07194fa9e5b177120fc2ba50b /keywords.c | |
parent | 8f84cc86e11f13b85c64fd0205261e12bef9e7f9 (diff) | |
download | perl-84ed01088568ffe9cf49047f10500ca511db0c9e.tar.gz |
[perl #80628] __SUB__
After much alternation, altercation and alteration, __SUB__ is
finally here.
Diffstat (limited to 'keywords.c')
-rw-r--r-- | keywords.c | 41 |
1 files changed, 31 insertions, 10 deletions
diff --git a/keywords.c b/keywords.c index 921d55077e..a37752f34c 100644 --- a/keywords.c +++ b/keywords.c @@ -1906,7 +1906,7 @@ Perl_keyword (pTHX_ const char *name, I32 len, bool all_keywords) goto unknown; } - case 7: /* 29 tokens of length 7 */ + case 7: /* 30 tokens of length 7 */ switch (name[0]) { case 'D': @@ -1923,14 +1923,35 @@ Perl_keyword (pTHX_ const char *name, I32 len, bool all_keywords) goto unknown; case '_': - if (name[1] == '_' && - name[2] == 'E' && - name[3] == 'N' && - name[4] == 'D' && - name[5] == '_' && - name[6] == '_') - { /* __END__ */ - return KEY___END__; + if (name[1] == '_') + { + switch (name[2]) + { + case 'E': + if (name[3] == 'N' && + name[4] == 'D' && + name[5] == '_' && + name[6] == '_') + { /* __END__ */ + return KEY___END__; + } + + goto unknown; + + case 'S': + if (name[3] == 'U' && + name[4] == 'B' && + name[5] == '_' && + name[6] == '_') + { /* __SUB__ */ + return (all_keywords || FEATURE_IS_ENABLED("__SUB__") ? -KEY___SUB__ : 0); + } + + goto unknown; + + default: + goto unknown; + } } goto unknown; @@ -3419,5 +3440,5 @@ unknown: } /* Generated from: - * 370a83cf6eed30dfe61a9dc611013e1014e0c5f537dc4f3872576ba8b9ef7572 regen/keywords.pl + * 76ce12941a02bdb120222155311eb8772ba4a4e8965a42ba347a077cac5b426e regen/keywords.pl * ex: set ro: */ |