Re: [perl #34493] h2ph `extern inline' problems
[p5sagit/p5-mst-13.2.git] / perly.y
diff --git a/perly.y b/perly.y
index 0d00b95..2d989b3 100644 (file)
--- a/perly.y
+++ b/perly.y
@@ -398,7 +398,7 @@ argexpr     :       argexpr ','
        ;
 
 /* List operators */
-listop :       LSTOP indirob argexpr          /* print $fh @args */
+listop :       LSTOP indirob argexpr /* map {...} @args or print $fh @args */
                        { $$ = convert($1, OPf_STACKED,
                                prepend_elem(OP_LIST, newGVREF($1,$2), $3) ); }
        |       FUNC '(' indirob expr ')'      /* print ($fh @args */
@@ -427,7 +427,7 @@ listop      :       LSTOP indirob argexpr          /* print $fh @args */
                        { $$ = convert($1, 0, $2); }
        |       FUNC '(' listexprcom ')'             /* print (@args) */
                        { $$ = convert($1, 0, $3); }
-       |       LSTOPSUB startanonsub block          /* map { foo } ... */
+       |       LSTOPSUB startanonsub block /* sub f(&@);   f { foo } ... */
                        { $3 = newANONATTRSUB($2, 0, Nullop, $3); }
                    listexpr            %prec LSTOP  /* ... @bar */
                        { $$ = newUNOP(OP_ENTERSUB, OPf_STACKED,
@@ -672,13 +672,12 @@ term      :       termbinop
                        { $$ = newUNOP(OP_ENTERSUB, OPf_STACKED,
                                scalar($1)); }
        |       FUNC1 '(' ')'                        /* not () */
-                       { $$ = newOP($1, OPf_SPECIAL); }
+                       { $$ = $1 == OP_NOT ? newUNOP($1, 0, newSVOP(OP_CONST, 0, newSViv(0)))
+                                           : newOP($1, OPf_SPECIAL); }
        |       FUNC1 '(' expr ')'                   /* not($foo) */
                        { $$ = newUNOP($1, 0, $3); }
-       |       PMFUNC '(' term ')'                  /* /foo/ */
-                       { $$ = pmruntime($1, $3, Nullop); }
-       |       PMFUNC '(' term ',' term ')'         /* s/foo/bar/ (or tr) */
-                       { $$ = pmruntime($1, $3, $5); }
+       |       PMFUNC '(' argexpr ')'           /* m//, s///, tr/// */
+                       { $$ = pmruntime($1, $3, 1); }
        |       WORD
        |       listop
        ;