X-Git-Url: https://perl5.git.perl.org/perl5.git/blobdiff_plain/fb73857aa0bfa8ed43d4d2f972c564c70a57e0c4..eedd3c3615d88ae5f720d5296d9bd81945898b9f:/perly.y?ds=sidebyside diff --git a/perly.y b/perly.y index 6313061..a1a1f0d 100644 --- a/perly.y +++ b/perly.y @@ -17,7 +17,7 @@ #include "perl.h" static void -dep() +dep(void) { deprecate("\"do\" to call subroutines"); } @@ -153,6 +153,9 @@ sideff : error { $$ = newLOOPOP(OPf_PARENS, 1, scalar($3), $1); } | expr UNTIL iexpr { $$ = newLOOPOP(OPf_PARENS, 1, $3, $1);} + | expr FOR expr + { $$ = newFOROP(0, Nullch, $2, + Nullop, $3, $1, Nullop); } ; else : /* NULL */ @@ -288,8 +291,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; } ; @@ -438,7 +442,7 @@ term : term ASSIGNOP term | scalar %prec '(' { $$ = $1; } | star '{' expr ';' '}' - { $$ = newBINOP(OP_GELEM, 0, newGVREF(0,$1), $3); } + { $$ = newBINOP(OP_GELEM, 0, $1, scalar($3)); } | star %prec '(' { $$ = $1; } | scalar '[' expr ']' %prec '('