X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=perly.y;h=f1de7c751e17794ac44ab6ad9e7b9d7151487d9d;hb=f7f713ed45383cfc8868c7c7e610ab988a7e0815;hp=47e632423a6c35a35657141c8437edf594216bec;hpb=78ca652eaf12f3ab6d7714883eec614d257f666a;p=p5sagit%2Fp5-mst-13.2.git diff --git a/perly.y b/perly.y index 47e6324..f1de7c7 100644 --- a/perly.y +++ b/perly.y @@ -14,20 +14,18 @@ %{ #include "EXTERN.h" +#define PERL_IN_PERLY_C #include "perl.h" -static void -dep(void) -{ - deprecate("\"do\" to call subroutines"); -} +#define dep() deprecate("\"do\" to call subroutines") %} %start prog %{ -#ifndef OEMVS +/* I sense a Big Blue pattern here... */ +#if !defined(OEMVS) && !defined(__OPEN_VM) && !defined(POSIX_BC) %} %union { @@ -38,7 +36,11 @@ dep(void) } %{ -#endif /* OEMVS */ +#endif /* !OEMVS && !__OPEN_VM && !POSIX_BC */ + +#ifdef USE_PURE_BISON +#define YYLEX_PARAM (&yychar) +#endif %} %token '{' ')' @@ -299,10 +301,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; } ; @@ -322,7 +324,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); } ; @@ -352,6 +354,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,