diff options
author | David Mitchell <davem@iabyn.com> | 2018-02-22 12:11:26 +0000 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2018-03-02 13:36:42 +0000 |
commit | 50333c9768fa52a79ec159c7a43b40948291861e (patch) | |
tree | 91ea2b71a71fc106a9f7c5751c27c6f830ef59ff /perly.y | |
parent | ae09f008e4b03a4215db8e3151cfb0ee5f20f004 (diff) | |
download | perl-50333c9768fa52a79ec159c7a43b40948291861e.tar.gz |
add Perl_init_named_cv() functiom
This moves a block of code out from perly.y into its own function,
because it will shortly be needed in more than one place.
Should be no functional changes.
Diffstat (limited to 'perly.y')
-rw-r--r-- | perly.y | 18 |
1 files changed, 1 insertions, 17 deletions
@@ -275,23 +275,7 @@ barestmt: PLUGSTMT } | SUB subname startsub { - if ($2->op_type == OP_CONST) { - const char *const name = - SvPV_nolen_const(((SVOP*)$2)->op_sv); - if (strEQ(name, "BEGIN") || strEQ(name, "END") - || strEQ(name, "INIT") || strEQ(name, "CHECK") - || strEQ(name, "UNITCHECK")) - CvSPECIAL_on(PL_compcv); - } - else - /* State subs inside anonymous subs need to be - clonable themselves. */ - if (CvANON(CvOUTSIDE(PL_compcv)) - || CvCLONE(CvOUTSIDE(PL_compcv)) - || !PadnameIsSTATE(PadlistNAMESARRAY(CvPADLIST( - CvOUTSIDE(PL_compcv) - ))[$2->op_targ])) - CvCLONE_on(PL_compcv); + init_named_cv(PL_compcv, $2); parser->in_my = 0; parser->in_my_stash = NULL; } |