summaryrefslogtreecommitdiff
path: root/toke.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2011-06-14 13:10:13 -0700
committerFather Chrysostomos <sprout@cpan.org>2011-06-14 13:17:51 -0700
commita5c70c4d9272459b07b8ddb9d839351659a0aea8 (patch)
tree8b2fa9347c57508e14fa5f99757c9bad72ad4bae /toke.c
parent87d00a71dc3f8397bffdc2e0691c50cb85519a68 (diff)
downloadperl-a5c70c4d9272459b07b8ddb9d839351659a0aea8.tar.gz
Allow ‘continue;’ without feature.pm
Since there is no conflict between ‘continue;’ and a user-defined sub- routine (it’s a syntax error, as ‘continue’ is already a keyword), there is no need to require the ‘switch’ feature to be enabled for this keyword. This actually simplifies the implementation.
Diffstat (limited to 'toke.c')
-rw-r--r--toke.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/toke.c b/toke.c
index 1e4beee4a9..3686162c60 100644
--- a/toke.c
+++ b/toke.c
@@ -7059,8 +7059,7 @@ Perl_yylex(pTHX)
Perl_croak(aTHX_ "CORE::%s is not a keyword", PL_tokenbuf);
if (tmp < 0)
tmp = -tmp;
- if (tmp == KEY_require || tmp == KEY_do ||
- tmp == KEY_continue)
+ else if (tmp == KEY_require || tmp == KEY_do)
/* that's a way to remember we saw "CORE::" */
orig_keyword = tmp;
goto reserved_word;
@@ -7100,14 +7099,6 @@ Perl_yylex(pTHX)
UNI(OP_CHOP);
case KEY_continue:
- /* When 'use switch' is in effect or when
- prefixed with CORE::, continue has a dual
- life as a control operator. */
- {
- if ( !FEATURE_IS_ENABLED("switch")
- && orig_keyword != KEY_continue )
- PREBLOCK(CONTINUE);
- else {
/* We have to disambiguate the two senses of
"continue". If the next token is a '{' then
treat it as the start of a continue block;
@@ -7118,8 +7109,6 @@ Perl_yylex(pTHX)
PREBLOCK(CONTINUE);
else
FUN0(OP_CONTINUE);
- }
- }
case KEY_chdir:
/* may use HOME */