fix bug in change#4515 (STOP blocks now see @ARGV like the rest)
authorGurusamy Sarathy <gsar@cpan.org>
Sun, 14 Nov 1999 03:37:37 +0000 (03:37 +0000)
committerGurusamy Sarathy <gsar@cpan.org>
Sun, 14 Nov 1999 03:37:37 +0000 (03:37 +0000)
p4raw-link: @4515 on //depot/perl: 4f25aa189c4a92535547c706ad37c13b7caee387

p4raw-id: //depot/perl@4578

perly.c
perly.y
t/op/misc.t
vms/perly_c.vms

diff --git a/perly.c b/perly.c
index f9734b3..2e47b11 100644 (file)
--- a/perly.c
+++ b/perly.c
@@ -1826,7 +1826,7 @@ case 59:
 #line 338 "perly.y"
 { STRLEN n_a; char *name = SvPV(((SVOP*)yyvsp[0].opval)->op_sv,n_a);
                          if (strEQ(name, "BEGIN") || strEQ(name, "END")
-                             || strEQ(name, "INIT"))
+                             || strEQ(name, "STOP") || strEQ(name, "INIT"))
                              CvSPECIAL_on(PL_compcv);
                          yyval.opval = yyvsp[0].opval; }
 break;
diff --git a/perly.y b/perly.y
index c8163e1..b238276 100644 (file)
--- a/perly.y
+++ b/perly.y
@@ -337,7 +337,7 @@ startformsub:       /* NULL */      /* start a format subroutine scope */
 
 subname        :       WORD    { STRLEN n_a; char *name = SvPV(((SVOP*)$1)->op_sv,n_a);
                          if (strEQ(name, "BEGIN") || strEQ(name, "END")
-                             || strEQ(name, "INIT"))
+                             || strEQ(name, "STOP") || strEQ(name, "INIT"))
                              CvSPECIAL_on(PL_compcv);
                          $$ = $1; }
        ;
index adfcd17..ab84977 100755 (executable)
@@ -353,16 +353,18 @@ Unmatched right curly bracket at (re_eval 1) line 1, at end of line
 syntax error at (re_eval 1) line 1, near ""{"}"
 Compilation failed in regexp at - line 1.
 ########
-BEGIN { @ARGV = qw(a b c) }
+BEGIN { @ARGV = qw(a b c d e) }
 BEGIN { print "argv <@ARGV>\nbegin <",shift,">\n" }
 END { print "end <",shift,">\nargv <@ARGV>\n" }
 INIT { print "init <",shift,">\n" }
+STOP { print "stop <",shift,">\n" }
 EXPECT
-argv <a b c>
+argv <a b c d e>
 begin <a>
-init <b>
-end <c>
-argv <>
+stop <b>
+init <c>
+end <d>
+argv <e>
 ########
 -l
 # fdopen from a system descriptor to a system descriptor used to close
index 4787247..ebc7d57 100644 (file)
@@ -1828,7 +1828,7 @@ case 59:
 #line 338 "perly.y"
 { STRLEN n_a; char *name = SvPV(((SVOP*)yyvsp[0].opval)->op_sv,n_a);
                          if (strEQ(name, "BEGIN") || strEQ(name, "END")
-                             || strEQ(name, "INIT"))
+                             || strEQ(name, "STOP") || strEQ(name, "INIT"))
                              CvSPECIAL_on(PL_compcv);
                          yyval.opval = yyvsp[0].opval; }
 break;