X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=perly.y;h=565439bcdf54abe075b47b40c56091393d054f67;hb=dd99ebda2fe680296a282a6804ed647eefc7f935;hp=5c7e6f7a946d505d638d1c94b547b11d8da62997;hpb=4eb4c1dff89e3fd33f51f2dd0ee19c2d963e5bf8;p=p5sagit%2Fp5-mst-13.2.git diff --git a/perly.y b/perly.y index 5c7e6f7..565439b 100644 --- a/perly.y +++ b/perly.y @@ -42,7 +42,7 @@ dep(void) #endif /* !OEMVS && !__OPEN_VM && !POSIX_BC */ #ifdef USE_PURE_BISON -#define YYLEXPARAM (&yychar) +#define YYLEX_PARAM (&yychar) #endif %} @@ -304,10 +304,10 @@ startformsub: /* NULL */ /* start a format subroutine scope */ { $$ = start_subparse(TRUE, 0); } ; -subname : WORD { char *name = SvPV(((SVOP*)$1)->op_sv, PL_na); +subname : WORD { STRLEN n_a; char *name = SvPV(((SVOP*)$1)->op_sv,n_a); if (strEQ(name, "BEGIN") || strEQ(name, "END") || strEQ(name, "INIT")) - CvUNIQUE_on(PL_compcv); + CvSPECIAL_on(PL_compcv); $$ = $1; } ; @@ -327,7 +327,7 @@ package : PACKAGE WORD ';' ; use : USE startsub - { CvUNIQUE_on(PL_compcv); /* It's a BEGIN {} */ } + { CvSPECIAL_on(PL_compcv); /* It's a BEGIN {} */ } WORD WORD listexpr ';' { utilize($1, $2, $4, $5, $6); } ; @@ -357,6 +357,10 @@ listop : LSTOP indirob argexpr append_elem(OP_LIST, prepend_elem(OP_LIST, scalar($1), $5), newUNOP(OP_METHOD, 0, $3))); } + | term ARROW method + { $$ = convert(OP_ENTERSUB, OPf_STACKED, + append_elem(OP_LIST, scalar($1), + newUNOP(OP_METHOD, 0, $3))); } | METHOD indirob listexpr { $$ = convert(OP_ENTERSUB, OPf_STACKED, append_elem(OP_LIST,