This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
fix icmp ping tests on cygwin
[perl5.git] / perly.y
diff --git a/perly.y b/perly.y
index 9143341..b4bdb48 100644 (file)
--- a/perly.y
+++ b/perly.y
@@ -292,7 +292,7 @@ barestmt:   PLUGSTMT
                          newFORM($2, $3, $4);
                          $$ = (OP*)NULL;
 #endif
-                         if (CvOUTSIDE(fmtcv) && !CvUNIQUE(CvOUTSIDE(fmtcv))) {
+                         if (CvOUTSIDE(fmtcv) && !CvEVAL(CvOUTSIDE(fmtcv))) {
                              SvREFCNT_inc_simple_void(fmtcv);
                              pad_add_anon(fmtcv, OP_NULL);
                          }
@@ -466,15 +466,9 @@ barestmt:  PLUGSTMT
                        }
        |       PACKAGE WORD WORD '{' remember
                        {
-                         int save_3_latefree = $3->op_latefree;
-                         $3->op_latefree = 1;
                          package($3);
-                         $3->op_latefree = save_3_latefree;
                          if ($2) {
-                             int save_2_latefree = $2->op_latefree;
-                             $2->op_latefree = 1;
                              package_version($2);
-                             $2->op_latefree = save_2_latefree;
                          }
                        }
                stmtseq '}'
@@ -482,9 +476,6 @@ barestmt:   PLUGSTMT
                          /* a block is a loop that happens once */
                          $$ = newWHILEOP(0, 1, (LOOP*)(OP*)NULL,
                                  (OP*)NULL, block_end($5, $7), (OP*)NULL, 0);
-                         op_free($3);
-                         if ($2)
-                             op_free($2);
                          TOKEN_GETMAD($4,$$,'{');
                          TOKEN_GETMAD($8,$$,'}');
                          if (PL_parser->copline > (line_t)IVAL($4))
@@ -1257,10 +1248,21 @@ term    :       termbinop
                          TOKEN_GETMAD($2,$$,'(');
                          TOKEN_GETMAD($4,$$,')');
                        }
-       |       PMFUNC '(' listexpr ')'         /* m//, s///, tr/// */
-                       { $$ = pmruntime($1, $3, 1);
-                         TOKEN_GETMAD($2,$$,'(');
-                         TOKEN_GETMAD($4,$$,')');
+       |       PMFUNC /* m//, s///, qr//, tr/// */
+                       {
+                           if (   $1->op_type != OP_TRANS
+                               && $1->op_type != OP_TRANSR
+                               && (((PMOP*)$1)->op_pmflags & PMf_HAS_CV))
+                           {
+                               $<ival>$ = start_subparse(FALSE, CVf_ANON);
+                               SAVEFREESV(PL_compcv);
+                           } else
+                               $<ival>$ = 0;
+                       }
+                   '(' listexpr ')'
+                       { $$ = pmruntime($1, $4, 1, $<ival>2);
+                         TOKEN_GETMAD($3,$$,'(');
+                         TOKEN_GETMAD($5,$$,')');
                        }
        |       WORD
        |       listop