+ parser->parsed_sub = 1;
+ }
+ | 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);
+ parser->in_my = 0;
+ parser->in_my_stash = NULL;
+ }
+ remember subsignature subattrlist '{' stmtseq '}'
+ {
+ OP *body;
+ if (parser->copline > (line_t)$8)
+ parser->copline = (line_t)$8;
+ body = block_end($5,
+ op_append_list(OP_LINESEQ, $6, $9));
+
+ SvREFCNT_inc_simple_void(PL_compcv);
+ $2->op_type == OP_CONST
+ ? newATTRSUB($3, $2, NULL, $7, body)
+ : newMYSUB($3, $2, NULL, $7, body)
+ ;
+ $$ = (OP*)NULL;
+ intro_my();
+ parser->parsed_sub = 1;