diff options
author | Father Chrysostomos <sprout@cpan.org> | 2011-06-14 13:10:13 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2011-06-14 13:17:51 -0700 |
commit | a5c70c4d9272459b07b8ddb9d839351659a0aea8 (patch) | |
tree | 8b2fa9347c57508e14fa5f99757c9bad72ad4bae /toke.c | |
parent | 87d00a71dc3f8397bffdc2e0691c50cb85519a68 (diff) | |
download | perl-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.c | 13 |
1 files changed, 1 insertions, 12 deletions
@@ -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 */ |