X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=perly.y;h=599652733107d169978ba0681b1cad4ee2d250e1;hb=b851de6cd1cc79b5e8ed7db02ebd0a9769d34232;hp=3bf1fdaf60b91d59aa8912e3277454e2c55276c0;hpb=b25809da6d2fc5e61497c7df6731abd5b4a2b2a8;p=p5sagit%2Fp5-mst-13.2.git diff --git a/perly.y b/perly.y index 3bf1fda..5996527 100644 --- a/perly.y +++ b/perly.y @@ -288,8 +288,9 @@ startformsub: /* NULL */ /* start a format subroutine scope */ { $$ = start_subparse(TRUE, 0); } ; -subname : WORD { char *name = SvPVx(((SVOP*)$1)->op_sv, na); - if (strEQ(name, "BEGIN") || strEQ(name, "END")) +subname : WORD { char *name = SvPV(((SVOP*)$1)->op_sv, na); + if (strEQ(name, "BEGIN") || strEQ(name, "END") + || strEQ(name, "INIT")) CvUNIQUE_on(compcv); $$ = $1; } ; @@ -529,6 +530,13 @@ term : term ASSIGNOP term prepend_elem(OP_LIST, $4, scalar(newCVREF(0,scalar($2))))); dep();} + | term ARROW '(' ')' %prec '(' + { $$ = newUNOP(OP_ENTERSUB, OPf_STACKED, + newCVREF(0, scalar($1))); } + | term ARROW '(' expr ')' %prec '(' + { $$ = newUNOP(OP_ENTERSUB, OPf_STACKED, + append_elem(OP_LIST, $4, + newCVREF(0, scalar($1)))); } | LOOPEX { $$ = newOP($1, OPf_SPECIAL); hints |= HINT_BLOCK_SCOPE; }