summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZefram <zefram@fysh.org>2009-12-15 11:48:31 +0100
committerRafael Garcia-Suarez <rgs@consttype.org>2009-12-15 11:48:31 +0100
commit421f30ed1e95009450bdc7905bf3433ee806ea4f (patch)
tree7bb77079cef0499e14323d0b6ec49fd59718199a
parent15dc519fb7cb1c4b51fbc196af8ecf273c534ad1 (diff)
downloadperl-421f30ed1e95009450bdc7905bf3433ee806ea4f.tar.gz
[perl #22977] Bug in format/write
-rw-r--r--MANIFEST1
-rw-r--r--perly.act286
-rw-r--r--perly.tab32
-rw-r--r--perly.y8
-rw-r--r--t/comp/form_scope.t18
5 files changed, 188 insertions, 157 deletions
diff --git a/MANIFEST b/MANIFEST
index cb599fdc82..ae5ce73d07 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -4190,6 +4190,7 @@ t/comp/colon.t See if colons are parsed correctly
t/comp/decl.t See if declarations work
t/comp/final_line_num.t See if line numbers are correct at EOF
t/comp/fold.t See if constant folding works
+t/comp/form_scope.t See if format scoping works
t/comp/hints.aux Auxillary file for %^H test
t/comp/hints.t See if %^H works
t/comp/line_debug_0.aux Auxiliary file for @{"_<$file"} test
diff --git a/perly.act b/perly.act
index bf80c54e03..6d20c29ed4 100644
--- a/perly.act
+++ b/perly.act
@@ -460,7 +460,9 @@ case 2:
case 62:
#line 514 "perly.y"
- { SvREFCNT_inc_simple_void(PL_compcv);
+ {
+ CV *fmtcv = PL_compcv;
+ SvREFCNT_inc_simple_void(PL_compcv);
#ifdef MAD
(yyval.opval) = newFORM((ps[(2) - (4)].val.ival), (ps[(3) - (4)].val.opval), (ps[(4) - (4)].val.opval));
prepend_madprops((ps[(1) - (4)].val.i_tkval)->tk_mad, (yyval.opval), 'F');
@@ -470,21 +472,25 @@ case 2:
newFORM((ps[(2) - (4)].val.ival), (ps[(3) - (4)].val.opval), (ps[(4) - (4)].val.opval));
(yyval.opval) = (OP*)NULL;
#endif
+ if (CvOUTSIDE(fmtcv) && !CvUNIQUE(CvOUTSIDE(fmtcv))) {
+ SvREFCNT_inc_simple_void(fmtcv);
+ pad_add_anon((SV*)fmtcv, OP_NULL);
+ }
;}
break;
case 63:
-#line 527 "perly.y"
+#line 533 "perly.y"
{ (yyval.opval) = (ps[(1) - (1)].val.opval); ;}
break;
case 64:
-#line 528 "perly.y"
+#line 534 "perly.y"
{ (yyval.opval) = (OP*)NULL; ;}
break;
case 65:
-#line 533 "perly.y"
+#line 539 "perly.y"
{ SvREFCNT_inc_simple_void(PL_compcv);
#ifdef MAD
(yyval.opval) = newMYSUB((ps[(2) - (6)].val.ival), (ps[(3) - (6)].val.opval), (ps[(4) - (6)].val.opval), (ps[(5) - (6)].val.opval), (ps[(6) - (6)].val.opval));
@@ -497,7 +503,7 @@ case 2:
break;
case 66:
-#line 546 "perly.y"
+#line 552 "perly.y"
{ SvREFCNT_inc_simple_void(PL_compcv);
#ifdef MAD
{
@@ -520,25 +526,25 @@ case 2:
break;
case 67:
-#line 568 "perly.y"
+#line 574 "perly.y"
{ (yyval.ival) = start_subparse(FALSE, 0);
SAVEFREESV(PL_compcv); ;}
break;
case 68:
-#line 574 "perly.y"
+#line 580 "perly.y"
{ (yyval.ival) = start_subparse(FALSE, CVf_ANON);
SAVEFREESV(PL_compcv); ;}
break;
case 69:
-#line 579 "perly.y"
+#line 585 "perly.y"
{ (yyval.ival) = start_subparse(TRUE, 0);
SAVEFREESV(PL_compcv); ;}
break;
case 70:
-#line 584 "perly.y"
+#line 590 "perly.y"
{ const char *const name = SvPV_nolen_const(((SVOP*)(ps[(1) - (1)].val.opval))->op_sv);
if (strEQ(name, "BEGIN") || strEQ(name, "END")
|| strEQ(name, "INIT") || strEQ(name, "CHECK")
@@ -548,24 +554,24 @@ case 2:
break;
case 71:
-#line 594 "perly.y"
+#line 600 "perly.y"
{ (yyval.opval) = (OP*)NULL; ;}
break;
case 73:
-#line 600 "perly.y"
+#line 606 "perly.y"
{ (yyval.opval) = (OP*)NULL; ;}
break;
case 74:
-#line 602 "perly.y"
+#line 608 "perly.y"
{ (yyval.opval) = (ps[(2) - (2)].val.opval);
TOKEN_GETMAD((ps[(1) - (2)].val.i_tkval),(yyval.opval),':');
;}
break;
case 75:
-#line 606 "perly.y"
+#line 612 "perly.y"
{ (yyval.opval) = IF_MAD(
newOP(OP_NULL, 0),
(OP*)NULL
@@ -575,14 +581,14 @@ case 2:
break;
case 76:
-#line 616 "perly.y"
+#line 622 "perly.y"
{ (yyval.opval) = (ps[(2) - (2)].val.opval);
TOKEN_GETMAD((ps[(1) - (2)].val.i_tkval),(yyval.opval),':');
;}
break;
case 77:
-#line 620 "perly.y"
+#line 626 "perly.y"
{ (yyval.opval) = IF_MAD(
newOP(OP_NULL, 0),
(OP*)NULL
@@ -592,12 +598,12 @@ case 2:
break;
case 78:
-#line 629 "perly.y"
+#line 635 "perly.y"
{ (yyval.opval) = (ps[(1) - (1)].val.opval); ;}
break;
case 79:
-#line 630 "perly.y"
+#line 636 "perly.y"
{ (yyval.opval) = IF_MAD(
newOP(OP_NULL,0),
(OP*)NULL
@@ -608,7 +614,7 @@ case 2:
break;
case 80:
-#line 640 "perly.y"
+#line 646 "perly.y"
{
#ifdef MAD
(yyval.opval) = package((ps[(3) - (4)].val.opval));
@@ -626,12 +632,12 @@ case 2:
break;
case 81:
-#line 657 "perly.y"
+#line 663 "perly.y"
{ CvSPECIAL_on(PL_compcv); /* It's a BEGIN {} */ ;}
break;
case 82:
-#line 659 "perly.y"
+#line 665 "perly.y"
{ SvREFCNT_inc_simple_void(PL_compcv);
#ifdef MAD
(yyval.opval) = utilize(IVAL((ps[(1) - (7)].val.i_tkval)), (ps[(2) - (7)].val.ival), (ps[(4) - (7)].val.opval), (ps[(5) - (7)].val.opval), (ps[(6) - (7)].val.opval));
@@ -648,28 +654,28 @@ case 2:
break;
case 83:
-#line 676 "perly.y"
+#line 682 "perly.y"
{ (yyval.opval) = newLOGOP(OP_AND, 0, (ps[(1) - (3)].val.opval), (ps[(3) - (3)].val.opval));
TOKEN_GETMAD((ps[(2) - (3)].val.i_tkval),(yyval.opval),'o');
;}
break;
case 84:
-#line 680 "perly.y"
+#line 686 "perly.y"
{ (yyval.opval) = newLOGOP(IVAL((ps[(2) - (3)].val.i_tkval)), 0, (ps[(1) - (3)].val.opval), (ps[(3) - (3)].val.opval));
TOKEN_GETMAD((ps[(2) - (3)].val.i_tkval),(yyval.opval),'o');
;}
break;
case 85:
-#line 684 "perly.y"
+#line 690 "perly.y"
{ (yyval.opval) = newLOGOP(OP_DOR, 0, (ps[(1) - (3)].val.opval), (ps[(3) - (3)].val.opval));
TOKEN_GETMAD((ps[(2) - (3)].val.i_tkval),(yyval.opval),'o');
;}
break;
case 87:
-#line 692 "perly.y"
+#line 698 "perly.y"
{
#ifdef MAD
OP* op = newNULLLIST();
@@ -682,7 +688,7 @@ case 2:
break;
case 88:
-#line 702 "perly.y"
+#line 708 "perly.y"
{
OP* term = (ps[(3) - (3)].val.opval);
DO_MAD(
@@ -694,7 +700,7 @@ case 2:
break;
case 90:
-#line 715 "perly.y"
+#line 721 "perly.y"
{ (yyval.opval) = convert(IVAL((ps[(1) - (3)].val.i_tkval)), OPf_STACKED,
prepend_elem(OP_LIST, newGVREF(IVAL((ps[(1) - (3)].val.i_tkval)),(ps[(2) - (3)].val.opval)), (ps[(3) - (3)].val.opval)) );
TOKEN_GETMAD((ps[(1) - (3)].val.i_tkval),(yyval.opval),'o');
@@ -702,7 +708,7 @@ case 2:
break;
case 91:
-#line 720 "perly.y"
+#line 726 "perly.y"
{ (yyval.opval) = convert(IVAL((ps[(1) - (5)].val.i_tkval)), OPf_STACKED,
prepend_elem(OP_LIST, newGVREF(IVAL((ps[(1) - (5)].val.i_tkval)),(ps[(3) - (5)].val.opval)), (ps[(4) - (5)].val.opval)) );
TOKEN_GETMAD((ps[(1) - (5)].val.i_tkval),(yyval.opval),'o');
@@ -712,7 +718,7 @@ case 2:
break;
case 92:
-#line 727 "perly.y"
+#line 733 "perly.y"
{ (yyval.opval) = convert(OP_ENTERSUB, OPf_STACKED,
append_elem(OP_LIST,
prepend_elem(OP_LIST, scalar((ps[(1) - (6)].val.opval)), (ps[(5) - (6)].val.opval)),
@@ -724,7 +730,7 @@ case 2:
break;
case 93:
-#line 736 "perly.y"
+#line 742 "perly.y"
{ (yyval.opval) = convert(OP_ENTERSUB, OPf_STACKED,
append_elem(OP_LIST, scalar((ps[(1) - (3)].val.opval)),
newUNOP(OP_METHOD, 0, (ps[(3) - (3)].val.opval))));
@@ -733,7 +739,7 @@ case 2:
break;
case 94:
-#line 742 "perly.y"
+#line 748 "perly.y"
{ (yyval.opval) = convert(OP_ENTERSUB, OPf_STACKED,
append_elem(OP_LIST,
prepend_elem(OP_LIST, (ps[(2) - (3)].val.opval), (ps[(3) - (3)].val.opval)),
@@ -742,7 +748,7 @@ case 2:
break;
case 95:
-#line 748 "perly.y"
+#line 754 "perly.y"
{ (yyval.opval) = convert(OP_ENTERSUB, OPf_STACKED,
append_elem(OP_LIST,
prepend_elem(OP_LIST, (ps[(2) - (5)].val.opval), (ps[(4) - (5)].val.opval)),
@@ -753,14 +759,14 @@ case 2:
break;
case 96:
-#line 756 "perly.y"
+#line 762 "perly.y"
{ (yyval.opval) = convert(IVAL((ps[(1) - (2)].val.i_tkval)), 0, (ps[(2) - (2)].val.opval));
TOKEN_GETMAD((ps[(1) - (2)].val.i_tkval),(yyval.opval),'o');
;}
break;
case 97:
-#line 760 "perly.y"
+#line 766 "perly.y"
{ (yyval.opval) = convert(IVAL((ps[(1) - (4)].val.i_tkval)), 0, (ps[(3) - (4)].val.opval));
TOKEN_GETMAD((ps[(1) - (4)].val.i_tkval),(yyval.opval),'o');
TOKEN_GETMAD((ps[(2) - (4)].val.i_tkval),(yyval.opval),'(');
@@ -769,13 +775,13 @@ case 2:
break;
case 98:
-#line 766 "perly.y"
+#line 772 "perly.y"
{ SvREFCNT_inc_simple_void(PL_compcv);
(yyval.opval) = newANONATTRSUB((ps[(2) - (3)].val.ival), 0, (OP*)NULL, (ps[(3) - (3)].val.opval)); ;}
break;
case 99:
-#line 769 "perly.y"
+#line 775 "perly.y"
{ (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_STACKED,
append_elem(OP_LIST,
prepend_elem(OP_LIST, (ps[(4) - (5)].val.opval), (ps[(5) - (5)].val.opval)), (ps[(1) - (5)].val.opval)));
@@ -783,7 +789,7 @@ case 2:
break;
case 102:
-#line 784 "perly.y"
+#line 790 "perly.y"
{ (yyval.opval) = newBINOP(OP_GELEM, 0, (ps[(1) - (5)].val.opval), scalar((ps[(3) - (5)].val.opval)));
PL_parser->expect = XOPERATOR;
TOKEN_GETMAD((ps[(2) - (5)].val.i_tkval),(yyval.opval),'{');
@@ -793,7 +799,7 @@ case 2:
break;
case 103:
-#line 791 "perly.y"
+#line 797 "perly.y"
{ (yyval.opval) = newBINOP(OP_AELEM, 0, oopsAV((ps[(1) - (4)].val.opval)), scalar((ps[(3) - (4)].val.opval)));
TOKEN_GETMAD((ps[(2) - (4)].val.i_tkval),(yyval.opval),'[');
TOKEN_GETMAD((ps[(4) - (4)].val.i_tkval),(yyval.opval),']');
@@ -801,7 +807,7 @@ case 2:
break;
case 104:
-#line 796 "perly.y"
+#line 802 "perly.y"
{ (yyval.opval) = newBINOP(OP_AELEM, 0,
ref(newAVREF((ps[(1) - (5)].val.opval)),OP_RV2AV),
scalar((ps[(4) - (5)].val.opval)));
@@ -812,7 +818,7 @@ case 2:
break;
case 105:
-#line 804 "perly.y"
+#line 810 "perly.y"
{ (yyval.opval) = newBINOP(OP_AELEM, 0,
ref(newAVREF((ps[(1) - (4)].val.opval)),OP_RV2AV),
scalar((ps[(3) - (4)].val.opval)));
@@ -822,7 +828,7 @@ case 2:
break;
case 106:
-#line 811 "perly.y"
+#line 817 "perly.y"
{ (yyval.opval) = newBINOP(OP_HELEM, 0, oopsHV((ps[(1) - (5)].val.opval)), jmaybe((ps[(3) - (5)].val.opval)));
PL_parser->expect = XOPERATOR;
TOKEN_GETMAD((ps[(2) - (5)].val.i_tkval),(yyval.opval),'{');
@@ -832,7 +838,7 @@ case 2:
break;
case 107:
-#line 818 "perly.y"
+#line 824 "perly.y"
{ (yyval.opval) = newBINOP(OP_HELEM, 0,
ref(newHVREF((ps[(1) - (6)].val.opval)),OP_RV2HV),
jmaybe((ps[(4) - (6)].val.opval)));
@@ -845,7 +851,7 @@ case 2:
break;
case 108:
-#line 828 "perly.y"
+#line 834 "perly.y"
{ (yyval.opval) = newBINOP(OP_HELEM, 0,
ref(newHVREF((ps[(1) - (5)].val.opval)),OP_RV2HV),
jmaybe((ps[(3) - (5)].val.opval)));
@@ -857,7 +863,7 @@ case 2:
break;
case 109:
-#line 837 "perly.y"
+#line 843 "perly.y"
{ (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_STACKED,
newCVREF(0, scalar((ps[(1) - (4)].val.opval))));
TOKEN_GETMAD((ps[(2) - (4)].val.i_tkval),(yyval.opval),'a');
@@ -867,7 +873,7 @@ case 2:
break;
case 110:
-#line 844 "perly.y"
+#line 850 "perly.y"
{ (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_STACKED,
append_elem(OP_LIST, (ps[(4) - (5)].val.opval),
newCVREF(0, scalar((ps[(1) - (5)].val.opval)))));
@@ -878,7 +884,7 @@ case 2:
break;
case 111:
-#line 853 "perly.y"
+#line 859 "perly.y"
{ (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_STACKED,
append_elem(OP_LIST, (ps[(3) - (4)].val.opval),
newCVREF(0, scalar((ps[(1) - (4)].val.opval)))));
@@ -888,7 +894,7 @@ case 2:
break;
case 112:
-#line 860 "perly.y"
+#line 866 "perly.y"
{ (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_STACKED,
newCVREF(0, scalar((ps[(1) - (3)].val.opval))));
TOKEN_GETMAD((ps[(2) - (3)].val.i_tkval),(yyval.opval),'(');
@@ -897,7 +903,7 @@ case 2:
break;
case 113:
-#line 866 "perly.y"
+#line 872 "perly.y"
{ (yyval.opval) = newSLICEOP(0, (ps[(5) - (6)].val.opval), (ps[(2) - (6)].val.opval));
TOKEN_GETMAD((ps[(1) - (6)].val.i_tkval),(yyval.opval),'(');
TOKEN_GETMAD((ps[(3) - (6)].val.i_tkval),(yyval.opval),')');
@@ -907,7 +913,7 @@ case 2:
break;
case 114:
-#line 873 "perly.y"
+#line 879 "perly.y"
{ (yyval.opval) = newSLICEOP(0, (ps[(4) - (5)].val.opval), (OP*)NULL);
TOKEN_GETMAD((ps[(1) - (5)].val.i_tkval),(yyval.opval),'(');
TOKEN_GETMAD((ps[(2) - (5)].val.i_tkval),(yyval.opval),')');
@@ -917,21 +923,21 @@ case 2:
break;
case 115:
-#line 883 "perly.y"
+#line 889 "perly.y"
{ (yyval.opval) = newASSIGNOP(OPf_STACKED, (ps[(1) - (3)].val.opval), IVAL((ps[(2) - (3)].val.i_tkval)), (ps[(3) - (3)].val.opval));
TOKEN_GETMAD((ps[(2) - (3)].val.i_tkval),(yyval.opval),'o');
;}
break;
case 116:
-#line 887 "perly.y"
+#line 893 "perly.y"
{ (yyval.opval) = newBINOP(IVAL((ps[(2) - (3)].val.i_tkval)), 0, scalar((ps[(1) - (3)].val.opval)), scalar((ps[(3) - (3)].val.opval)));
TOKEN_GETMAD((ps[(2) - (3)].val.i_tkval),(yyval.opval),'o');
;}
break;
case 117:
-#line 891 "perly.y"
+#line 897 "perly.y"
{ if (IVAL((ps[(2) - (3)].val.i_tkval)) != OP_REPEAT)
scalar((ps[(1) - (3)].val.opval));
(yyval.opval) = newBINOP(IVAL((ps[(2) - (3)].val.i_tkval)), 0, (ps[(1) - (3)].val.opval), scalar((ps[(3) - (3)].val.opval)));
@@ -940,49 +946,49 @@ case 2:
break;
case 118:
-#line 897 "perly.y"
+#line 903 "perly.y"
{ (yyval.opval) = newBINOP(IVAL((ps[(2) - (3)].val.i_tkval)), 0, scalar((ps[(1) - (3)].val.opval)), scalar((ps[(3) - (3)].val.opval)));
TOKEN_GETMAD((ps[(2) - (3)].val.i_tkval),(yyval.opval),'o');
;}
break;
case 119:
-#line 901 "perly.y"
+#line 907 "perly.y"
{ (yyval.opval) = newBINOP(IVAL((ps[(2) - (3)].val.i_tkval)), 0, scalar((ps[(1) - (3)].val.opval)), scalar((ps[(3) - (3)].val.opval)));
TOKEN_GETMAD((ps[(2) - (3)].val.i_tkval),(yyval.opval),'o');
;}
break;
case 120:
-#line 905 "perly.y"
+#line 911 "perly.y"
{ (yyval.opval) = newBINOP(IVAL((ps[(2) - (3)].val.i_tkval)), 0, scalar((ps[(1) - (3)].val.opval)), scalar((ps[(3) - (3)].val.opval)));
TOKEN_GETMAD((ps[(2) - (3)].val.i_tkval),(yyval.opval),'o');
;}
break;
case 121:
-#line 909 "perly.y"
+#line 915 "perly.y"
{ (yyval.opval) = newBINOP(IVAL((ps[(2) - (3)].val.i_tkval)), 0, scalar((ps[(1) - (3)].val.opval)), scalar((ps[(3) - (3)].val.opval)));
TOKEN_GETMAD((ps[(2) - (3)].val.i_tkval),(yyval.opval),'o');
;}
break;
case 122:
-#line 913 "perly.y"
+#line 919 "perly.y"
{ (yyval.opval) = newBINOP(IVAL((ps[(2) - (3)].val.i_tkval)), 0, scalar((ps[(1) - (3)].val.opval)), scalar((ps[(3) - (3)].val.opval)));
TOKEN_GETMAD((ps[(2) - (3)].val.i_tkval),(yyval.opval),'o');
;}
break;
case 123:
-#line 917 "perly.y"
+#line 923 "perly.y"
{ (yyval.opval) = newBINOP(IVAL((ps[(2) - (3)].val.i_tkval)), 0, scalar((ps[(1) - (3)].val.opval)), scalar((ps[(3) - (3)].val.opval)));
TOKEN_GETMAD((ps[(2) - (3)].val.i_tkval),(yyval.opval),'o');
;}
break;
case 124:
-#line 921 "perly.y"
+#line 927 "perly.y"
{
(yyval.opval) = newRANGE(IVAL((ps[(2) - (3)].val.i_tkval)), scalar((ps[(1) - (3)].val.opval)), scalar((ps[(3) - (3)].val.opval)));
DO_MAD({
@@ -997,28 +1003,28 @@ case 2:
break;
case 125:
-#line 933 "perly.y"
+#line 939 "perly.y"
{ (yyval.opval) = newLOGOP(OP_AND, 0, (ps[(1) - (3)].val.opval), (ps[(3) - (3)].val.opval));
TOKEN_GETMAD((ps[(2) - (3)].val.i_tkval),(yyval.opval),'o');
;}
break;
case 126:
-#line 937 "perly.y"
+#line 943 "perly.y"
{ (yyval.opval) = newLOGOP(OP_OR, 0, (ps[(1) - (3)].val.opval), (ps[(3) - (3)].val.opval));
TOKEN_GETMAD((ps[(2) - (3)].val.i_tkval),(yyval.opval),'o');
;}
break;
case 127:
-#line 941 "perly.y"
+#line 947 "perly.y"
{ (yyval.opval) = newLOGOP(OP_DOR, 0, (ps[(1) - (3)].val.opval), (ps[(3) - (3)].val.opval));
TOKEN_GETMAD((ps[(2) - (3)].val.i_tkval),(yyval.opval),'o');
;}
break;
case 128:
-#line 945 "perly.y"
+#line 951 "perly.y"
{ (yyval.opval) = bind_match(IVAL((ps[(2) - (3)].val.i_tkval)), (ps[(1) - (3)].val.opval), (ps[(3) - (3)].val.opval));
TOKEN_GETMAD((ps[(2) - (3)].val.i_tkval),
((yyval.opval)->op_type == OP_NOT
@@ -1028,14 +1034,14 @@ case 2:
break;
case 129:
-#line 955 "perly.y"
+#line 961 "perly.y"
{ (yyval.opval) = newUNOP(OP_NEGATE, 0, scalar((ps[(2) - (2)].val.opval)));
TOKEN_GETMAD((ps[(1) - (2)].val.i_tkval),(yyval.opval),'o');
;}
break;
case 130:
-#line 959 "perly.y"
+#line 965 "perly.y"
{ (yyval.opval) = IF_MAD(
newUNOP(OP_NULL, 0, (ps[(2) - (2)].val.opval)),
(ps[(2) - (2)].val.opval)
@@ -1045,21 +1051,21 @@ case 2:
break;
case 131:
-#line 966 "perly.y"
+#line 972 "perly.y"
{ (yyval.opval) = newUNOP(OP_NOT, 0, scalar((ps[(2) - (2)].val.opval)));
TOKEN_GETMAD((ps[(1) - (2)].val.i_tkval),(yyval.opval),'o');
;}
break;
case 132:
-#line 970 "perly.y"
+#line 976 "perly.y"
{ (yyval.opval) = newUNOP(OP_COMPLEMENT, 0, scalar((ps[(2) - (2)].val.opval)));
TOKEN_GETMAD((ps[(1) - (2)].val.i_tkval),(yyval.opval),'o');
;}
break;
case 133:
-#line 974 "perly.y"
+#line 980 "perly.y"
{ (yyval.opval) = newUNOP(OP_POSTINC, 0,
mod(scalar((ps[(1) - (2)].val.opval)), OP_POSTINC));
TOKEN_GETMAD((ps[(2) - (2)].val.i_tkval),(yyval.opval),'o');
@@ -1067,7 +1073,7 @@ case 2:
break;
case 134:
-#line 979 "perly.y"
+#line 985 "perly.y"
{ (yyval.opval) = newUNOP(OP_POSTDEC, 0,
mod(scalar((ps[(1) - (2)].val.opval)), OP_POSTDEC));
TOKEN_GETMAD((ps[(2) - (2)].val.i_tkval),(yyval.opval),'o');
@@ -1075,7 +1081,7 @@ case 2:
break;
case 135:
-#line 984 "perly.y"
+#line 990 "perly.y"
{ (yyval.opval) = newUNOP(OP_PREINC, 0,
mod(scalar((ps[(2) - (2)].val.opval)), OP_PREINC));
TOKEN_GETMAD((ps[(1) - (2)].val.i_tkval),(yyval.opval),'o');
@@ -1083,7 +1089,7 @@ case 2:
break;
case 136:
-#line 989 "perly.y"
+#line 995 "perly.y"
{ (yyval.opval) = newUNOP(OP_PREDEC, 0,
mod(scalar((ps[(2) - (2)].val.opval)), OP_PREDEC));
TOKEN_GETMAD((ps[(1) - (2)].val.i_tkval),(yyval.opval),'o');
@@ -1091,7 +1097,7 @@ case 2:
break;
case 137:
-#line 998 "perly.y"
+#line 1004 "perly.y"
{ (yyval.opval) = newANONLIST((ps[(2) - (3)].val.opval));
TOKEN_GETMAD((ps[(1) - (3)].val.i_tkval),(yyval.opval),'[');
TOKEN_GETMAD((ps[(3) - (3)].val.i_tkval),(yyval.opval),']');
@@ -1099,7 +1105,7 @@ case 2:
break;
case 138:
-#line 1003 "perly.y"
+#line 1009 "perly.y"
{ (yyval.opval) = newANONLIST((OP*)NULL);
TOKEN_GETMAD((ps[(1) - (2)].val.i_tkval),(yyval.opval),'[');
TOKEN_GETMAD((ps[(2) - (2)].val.i_tkval),(yyval.opval),']');
@@ -1107,7 +1113,7 @@ case 2:
break;
case 139:
-#line 1008 "perly.y"
+#line 1014 "perly.y"
{ (yyval.opval) = newANONHASH((ps[(2) - (4)].val.opval));
TOKEN_GETMAD((ps[(1) - (4)].val.i_tkval),(yyval.opval),'{');
TOKEN_GETMAD((ps[(3) - (4)].val.i_tkval),(yyval.opval),';');
@@ -1116,7 +1122,7 @@ case 2:
break;
case 140:
-#line 1014 "perly.y"
+#line 1020 "perly.y"
{ (yyval.opval) = newANONHASH((OP*)NULL);
TOKEN_GETMAD((ps[(1) - (3)].val.i_tkval),(yyval.opval),'{');
TOKEN_GETMAD((ps[(2) - (3)].val.i_tkval),(yyval.opval),';');
@@ -1125,7 +1131,7 @@ case 2:
break;
case 141:
-#line 1020 "perly.y"
+#line 1026 "perly.y"
{ SvREFCNT_inc_simple_void(PL_compcv);
(yyval.opval) = newANONATTRSUB((ps[(2) - (5)].val.ival), (ps[(3) - (5)].val.opval), (ps[(4) - (5)].val.opval), (ps[(5) - (5)].val.opval));
TOKEN_GETMAD((ps[(1) - (5)].val.i_tkval),(yyval.opval),'o');
@@ -1135,21 +1141,21 @@ case 2:
break;
case 142:
-#line 1031 "perly.y"
+#line 1037 "perly.y"
{ (yyval.opval) = dofile((ps[(2) - (2)].val.opval), IVAL((ps[(1) - (2)].val.i_tkval)));
TOKEN_GETMAD((ps[(1) - (2)].val.i_tkval),(yyval.opval),'o');
;}
break;
case 143:
-#line 1035 "perly.y"
+#line 1041 "perly.y"
{ (yyval.opval) = newUNOP(OP_NULL, OPf_SPECIAL, scope((ps[(2) - (2)].val.opval)));
TOKEN_GETMAD((ps[(1) - (2)].val.i_tkval),(yyval.opval),'D');
;}
break;
case 144:
-#line 1039 "perly.y"
+#line 1045 "perly.y"
{ (yyval.opval) = newUNOP(OP_ENTERSUB,
OPf_SPECIAL|OPf_STACKED,
prepend_elem(OP_LIST,
@@ -1164,7 +1170,7 @@ case 2:
break;
case 145:
-#line 1051 "perly.y"
+#line 1057 "perly.y"
{ (yyval.opval) = newUNOP(OP_ENTERSUB,
OPf_SPECIAL|OPf_STACKED,
append_elem(OP_LIST,
@@ -1180,7 +1186,7 @@ case 2:
break;
case 146:
-#line 1064 "perly.y"
+#line 1070 "perly.y"
{ (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_SPECIAL|OPf_STACKED,
prepend_elem(OP_LIST,
scalar(newCVREF(0,scalar((ps[(2) - (4)].val.opval)))), (OP*)NULL)); dep();
@@ -1191,7 +1197,7 @@ case 2:
break;
case 147:
-#line 1072 "perly.y"
+#line 1078 "perly.y"
{ (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_SPECIAL|OPf_STACKED,
prepend_elem(OP_LIST,
(ps[(4) - (5)].val.opval),
@@ -1203,7 +1209,7 @@ case 2:
break;
case 152:
-#line 1088 "perly.y"
+#line 1094 "perly.y"
{ (yyval.opval) = newCONDOP(0, (ps[(1) - (5)].val.opval), (ps[(3) - (5)].val.opval), (ps[(5) - (5)].val.opval));
TOKEN_GETMAD((ps[(2) - (5)].val.i_tkval),(yyval.opval),'?');
TOKEN_GETMAD((ps[(4) - (5)].val.i_tkval),(yyval.opval),':');
@@ -1211,26 +1217,26 @@ case 2:
break;
case 153:
-#line 1093 "perly.y"
+#line 1099 "perly.y"
{ (yyval.opval) = newUNOP(OP_REFGEN, 0, mod((ps[(2) - (2)].val.opval),OP_REFGEN));
TOKEN_GETMAD((ps[(1) - (2)].val.i_tkval),(yyval.opval),'o');
;}
break;
case 154:
-#line 1097 "perly.y"
+#line 1103 "perly.y"
{ (yyval.opval) = (ps[(1) - (1)].val.opval); ;}
break;
case 155:
-#line 1099 "perly.y"
+#line 1105 "perly.y"
{ (yyval.opval) = localize((ps[(2) - (2)].val.opval),IVAL((ps[(1) - (2)].val.i_tkval)));
TOKEN_GETMAD((ps[(1) - (2)].val.i_tkval),(yyval.opval),'k');
;}
break;
case 156:
-#line 1103 "perly.y"
+#line 1109 "perly.y"
{ (yyval.opval) = sawparens(IF_MAD(newUNOP(OP_NULL,0,(ps[(2) - (3)].val.opval)), (ps[(2) - (3)].val.opval)));
TOKEN_GETMAD((ps[(1) - (3)].val.i_tkval),(yyval.opval),'(');
TOKEN_GETMAD((ps[(3) - (3)].val.i_tkval),(yyval.opval),')');
@@ -1238,7 +1244,7 @@ case 2:
break;
case 157:
-#line 1108 "perly.y"
+#line 1114 "perly.y"
{ (yyval.opval) = sawparens(newNULLLIST());
TOKEN_GETMAD((ps[(1) - (2)].val.i_tkval),(yyval.opval),'(');
TOKEN_GETMAD((ps[(2) - (2)].val.i_tkval),(yyval.opval),')');
@@ -1246,37 +1252,37 @@ case 2:
break;
case 158:
-#line 1113 "perly.y"
+#line 1119 "perly.y"
{ (yyval.opval) = (ps[(1) - (1)].val.opval); ;}
break;
case 159:
-#line 1115 "perly.y"
+#line 1121 "perly.y"
{ (yyval.opval) = (ps[(1) - (1)].val.opval); ;}
break;
case 160:
-#line 1117 "perly.y"
+#line 1123 "perly.y"
{ (yyval.opval) = (ps[(1) - (1)].val.opval); ;}
break;
case 161:
-#line 1119 "perly.y"
+#line 1125 "perly.y"
{ (yyval.opval) = (ps[(1) - (1)].val.opval); ;}
break;
case 162:
-#line 1121 "perly.y"
+#line 1127 "perly.y"
{ (yyval.opval) = newUNOP(OP_AV2ARYLEN, 0, ref((ps[(1) - (1)].val.opval), OP_AV2ARYLEN));;}
break;
case 163:
-#line 1123 "perly.y"
+#line 1129 "perly.y"
{ (yyval.opval) = (ps[(1) - (1)].val.opval); ;}
break;
case 164:
-#line 1125 "perly.y"
+#line 1131 "perly.y"
{ (yyval.opval) = prepend_elem(OP_ASLICE,
newOP(OP_PUSHMARK, 0),
newLISTOP(OP_ASLICE, 0,
@@ -1288,7 +1294,7 @@ case 2:
break;
case 165:
-#line 1134 "perly.y"
+#line 1140 "perly.y"
{ (yyval.opval) = prepend_elem(OP_HSLICE,
newOP(OP_PUSHMARK, 0),
newLISTOP(OP_HSLICE, 0,
@@ -1302,17 +1308,17 @@ case 2:
break;
case 166:
-#line 1145 "perly.y"
+#line 1151 "perly.y"
{ (yyval.opval) = (ps[(1) - (1)].val.opval); ;}
break;
case 167:
-#line 1147 "perly.y"
+#line 1153 "perly.y"
{ (yyval.opval) = newUNOP(OP_ENTERSUB, 0, scalar((ps[(1) - (1)].val.opval))); ;}
break;
case 168:
-#line 1149 "perly.y"
+#line 1155 "perly.y"
{ (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_STACKED, scalar((ps[(1) - (3)].val.opval)));
TOKEN_GETMAD((ps[(2) - (3)].val.i_tkval),(yyval.opval),'(');
TOKEN_GETMAD((ps[(3) - (3)].val.i_tkval),(yyval.opval),')');
@@ -1320,7 +1326,7 @@ case 2:
break;
case 169:
-#line 1154 "perly.y"
+#line 1160 "perly.y"
{
(yyval.opval) = newUNOP(OP_ENTERSUB, OPf_STACKED,
append_elem(OP_LIST, (ps[(3) - (4)].val.opval), scalar((ps[(1) - (4)].val.opval))));
@@ -1336,7 +1342,7 @@ case 2:
break;
case 170:
-#line 1167 "perly.y"
+#line 1173 "perly.y"
{ (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_STACKED,
append_elem(OP_LIST, (ps[(3) - (3)].val.opval), scalar((ps[(2) - (3)].val.opval))));
TOKEN_GETMAD((ps[(1) - (3)].val.i_tkval),(yyval.opval),'o');
@@ -1344,7 +1350,7 @@ case 2:
break;
case 171:
-#line 1172 "perly.y"
+#line 1178 "perly.y"
{ (yyval.opval) = newOP(IVAL((ps[(1) - (1)].val.i_tkval)), OPf_SPECIAL);
PL_hints |= HINT_BLOCK_SCOPE;
TOKEN_GETMAD((ps[(1) - (1)].val.i_tkval),(yyval.opval),'o');
@@ -1352,74 +1358,74 @@ case 2:
break;
case 172:
-#line 1177 "perly.y"
+#line 1183 "perly.y"
{ (yyval.opval) = newLOOPEX(IVAL((ps[(1) - (2)].val.i_tkval)),(ps[(2) - (2)].val.opval));
TOKEN_GETMAD((ps[(1) - (2)].val.i_tkval),(yyval.opval),'o');
;}
break;
case 173:
-#line 1181 "perly.y"
+#line 1187 "perly.y"
{ (yyval.opval) = newUNOP(OP_NOT, 0, scalar((ps[(2) - (2)].val.opval)));
TOKEN_GETMAD((ps[(1) - (2)].val.i_tkval),(yyval.opval),'o');
;}
break;
case 174:
-#line 1185 "perly.y"
+#line 1191 "perly.y"
{ (yyval.opval) = newOP(IVAL((ps[(1) - (1)].val.i_tkval)), 0);
TOKEN_GETMAD((ps[(1) - (1)].val.i_tkval),(yyval.opval),'o');
;}
break;
case 175:
-#line 1189 "perly.y"
+#line 1195 "perly.y"
{ (yyval.opval) = newUNOP(IVAL((ps[(1) - (2)].val.i_tkval)), 0, (ps[(2) - (2)].val.opval));
TOKEN_GETMAD((ps[(1) - (2)].val.i_tkval),(yyval.opval),'o');
;}
break;
case 176:
-#line 1193 "perly.y"
+#line 1199 "perly.y"
{ (yyval.opval) = newUNOP(IVAL((ps[(1) - (2)].val.i_tkval)), 0, (ps[(2) - (2)].val.opval));
TOKEN_GETMAD((ps[(1) - (2)].val.i_tkval),(yyval.opval),'o');
;}
break;
case 177:
-#line 1197 "perly.y"
+#line 1203 "perly.y"
{ (yyval.opval) = newOP(OP_REQUIRE, (ps[(1) - (1)].val.i_tkval) ? OPf_SPECIAL : 0);
TOKEN_GETMAD((ps[(1) - (1)].val.i_tkval),(yyval.opval),'o');
;}
break;
case 178:
-#line 1201 "perly.y"
+#line 1207 "perly.y"
{ (yyval.opval) = newUNOP(OP_REQUIRE, (ps[(1) - (2)].val.i_tkval) ? OPf_SPECIAL : 0, (ps[(2) - (2)].val.opval));
TOKEN_GETMAD((ps[(1) - (2)].val.i_tkval),(yyval.opval),'o');
;}
break;
case 179:
-#line 1205 "perly.y"
+#line 1211 "perly.y"
{ (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_STACKED, scalar((ps[(1) - (1)].val.opval))); ;}
break;
case 180:
-#line 1207 "perly.y"
+#line 1213 "perly.y"
{ (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_STACKED,
append_elem(OP_LIST, (ps[(2) - (2)].val.opval), scalar((ps[(1) - (2)].val.opval)))); ;}
break;
case 181:
-#line 1210 "perly.y"
+#line 1216 "perly.y"
{ (yyval.opval) = newOP(IVAL((ps[(1) - (1)].val.i_tkval)), 0);
TOKEN_GETMAD((ps[(1) - (1)].val.i_tkval),(yyval.opval),'o');
;}
break;
case 182:
-#line 1214 "perly.y"
+#line 1220 "perly.y"
{ (yyval.opval) = newOP(IVAL((ps[(1) - (3)].val.i_tkval)), 0);
TOKEN_GETMAD((ps[(1) - (3)].val.i_tkval),(yyval.opval),'o');
TOKEN_GETMAD((ps[(2) - (3)].val.i_tkval),(yyval.opval),'(');
@@ -1428,13 +1434,13 @@ case 2:
break;
case 183:
-#line 1220 "perly.y"
+#line 1226 "perly.y"
{ (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_STACKED,
scalar((ps[(1) - (1)].val.opval))); ;}
break;
case 184:
-#line 1223 "perly.y"
+#line 1229 "perly.y"
{ (yyval.opval) = (IVAL((ps[(1) - (3)].val.i_tkval)) == OP_NOT)
? newUNOP(IVAL((ps[(1) - (3)].val.i_tkval)), 0, newSVOP(OP_CONST, 0, newSViv(0)))
: newOP(IVAL((ps[(1) - (3)].val.i_tkval)), OPf_SPECIAL);
@@ -1446,7 +1452,7 @@ case 2:
break;
case 185:
-#line 1232 "perly.y"
+#line 1238 "perly.y"
{ (yyval.opval) = newUNOP(IVAL((ps[(1) - (4)].val.i_tkval)), 0, (ps[(3) - (4)].val.opval));
TOKEN_GETMAD((ps[(1) - (4)].val.i_tkval),(yyval.opval),'o');
TOKEN_GETMAD((ps[(2) - (4)].val.i_tkval),(yyval.opval),'(');
@@ -1455,7 +1461,7 @@ case 2:
break;
case 186:
-#line 1238 "perly.y"
+#line 1244 "perly.y"
{ (yyval.opval) = pmruntime((ps[(1) - (4)].val.opval), (ps[(3) - (4)].val.opval), 1);
TOKEN_GETMAD((ps[(2) - (4)].val.i_tkval),(yyval.opval),'(');
TOKEN_GETMAD((ps[(4) - (4)].val.i_tkval),(yyval.opval),')');
@@ -1463,7 +1469,7 @@ case 2:
break;
case 189:
-#line 1245 "perly.y"
+#line 1251 "perly.y"
{
(yyval.opval) = newLISTOP(OP_DIE, 0, newOP(OP_PUSHMARK, 0),
newSVOP(OP_CONST, 0, newSVpvs("Unimplemented")));
@@ -1472,7 +1478,7 @@ case 2:
break;
case 191:
-#line 1255 "perly.y"
+#line 1261 "perly.y"
{ (yyval.opval) = my_attrs((ps[(2) - (3)].val.opval),(ps[(3) - (3)].val.opval));
DO_MAD(
token_getmad((ps[(1) - (3)].val.i_tkval),(yyval.opval),'d');
@@ -1483,14 +1489,14 @@ case 2:
break;
case 192:
-#line 1263 "perly.y"
+#line 1269 "perly.y"
{ (yyval.opval) = localize((ps[(2) - (2)].val.opval),IVAL((ps[(1) - (2)].val.i_tkval)));
TOKEN_GETMAD((ps[(1) - (2)].val.i_tkval),(yyval.opval),'d');
;}
break;
case 193:
-#line 1270 "perly.y"
+#line 1276 "perly.y"
{ (yyval.opval) = sawparens((ps[(2) - (3)].val.opval));
TOKEN_GETMAD((ps[(1) - (3)].val.i_tkval),(yyval.opval),'(');
TOKEN_GETMAD((ps[(3) - (3)].val.i_tkval),(yyval.opval),')');
@@ -1498,7 +1504,7 @@ case 2:
break;
case 194:
-#line 1275 "perly.y"
+#line 1281 "perly.y"
{ (yyval.opval) = sawparens(newNULLLIST());
TOKEN_GETMAD((ps[(1) - (2)].val.i_tkval),(yyval.opval),'(');
TOKEN_GETMAD((ps[(2) - (2)].val.i_tkval),(yyval.opval),')');
@@ -1506,42 +1512,42 @@ case 2:
break;
case 195:
-#line 1280 "perly.y"
+#line 1286 "perly.y"
{ (yyval.opval) = (ps[(1) - (1)].val.opval); ;}
break;
case 196:
-#line 1282 "perly.y"
+#line 1288 "perly.y"
{ (yyval.opval) = (ps[(1) - (1)].val.opval); ;}
break;
case 197:
-#line 1284 "perly.y"
+#line 1290 "perly.y"
{ (yyval.opval) = (ps[(1) - (1)].val.opval); ;}
break;
case 198:
-#line 1289 "perly.y"
+#line 1295 "perly.y"
{ (yyval.opval) = (OP*)NULL; ;}
break;
case 199:
-#line 1291 "perly.y"
+#line 1297 "perly.y"
{ (yyval.opval) = (ps[(1) - (1)].val.opval); ;}
break;
case 200:
-#line 1295 "perly.y"
+#line 1301 "perly.y"
{ (yyval.opval) = (OP*)NULL; ;}
break;
case 201:
-#line 1297 "perly.y"
+#line 1303 "perly.y"
{ (yyval.opval) = (ps[(1) - (1)].val.opval); ;}
break;
case 202:
-#line 1299 "perly.y"
+#line 1305 "perly.y"
{
#ifdef MAD
OP* op = newNULLLIST();
@@ -1555,69 +1561,69 @@ case 2:
break;
case 203:
-#line 1314 "perly.y"
+#line 1320 "perly.y"
{ PL_parser->in_my = 0; (yyval.opval) = my((ps[(1) - (1)].val.opval)); ;}
break;
case 204:
-#line 1318 "perly.y"
+#line 1324 "perly.y"
{ (yyval.opval) = newCVREF(IVAL((ps[(1) - (2)].val.i_tkval)),(ps[(2) - (2)].val.opval));
TOKEN_GETMAD((ps[(1) - (2)].val.i_tkval),(yyval.opval),'&');
;}
break;
case 205:
-#line 1324 "perly.y"
+#line 1330 "perly.y"
{ (yyval.opval) = newSVREF((ps[(2) - (2)].val.opval));
TOKEN_GETMAD((ps[(1) - (2)].val.i_tkval),(yyval.opval),'$');
;}
break;
case 206:
-#line 1330 "perly.y"
+#line 1336 "perly.y"
{ (yyval.opval) = newAVREF((ps[(2) - (2)].val.opval));
TOKEN_GETMAD((ps[(1) - (2)].val.i_tkval),(yyval.opval),'@');
;}
break;
case 207:
-#line 1336 "perly.y"
+#line 1342 "perly.y"
{ (yyval.opval) = newHVREF((ps[(2) - (2)].val.opval));
TOKEN_GETMAD((ps[(1) - (2)].val.i_tkval),(yyval.opval),'%');
;}
break;
case 208:
-#line 1342 "perly.y"
+#line 1348 "perly.y"
{ (yyval.opval) = newAVREF((ps[(2) - (2)].val.opval));
TOKEN_GETMAD((ps[(1) - (2)].val.i_tkval),(yyval.opval),'l');
;}
break;
case 209:
-#line 1348 "perly.y"
+#line 1354 "perly.y"
{ (yyval.opval) = newGVREF(0,(ps[(2) - (2)].val.opval));
TOKEN_GETMAD((ps[(1) - (2)].val.i_tkval),(yyval.opval),'*');
;}
break;
case 210:
-#line 1355 "perly.y"
+#line 1361 "perly.y"
{ (yyval.opval) = scalar((ps[(1) - (1)].val.opval)); ;}
break;
case 211:
-#line 1357 "perly.y"
+#line 1363 "perly.y"
{ (yyval.opval) = scalar((ps[(1) - (1)].val.opval)); ;}
break;
case 212:
-#line 1359 "perly.y"
+#line 1365 "perly.y"
{ (yyval.opval) = scope((ps[(1) - (1)].val.opval)); ;}
break;
case 213:
-#line 1362 "perly.y"
+#line 1368 "perly.y"
{ (yyval.opval) = (ps[(1) - (1)].val.opval); ;}
break;
diff --git a/perly.tab b/perly.tab
index 0a9a65c20a..34096e145e 100644
--- a/perly.tab
+++ b/perly.tab
@@ -174,22 +174,22 @@ static const yytype_uint16 yyrline[] =
297, 305, 316, 319, 325, 326, 333, 346, 358, 369,
379, 389, 421, 429, 439, 445, 446, 451, 454, 458,
463, 467, 471, 477, 486, 490, 492, 494, 496, 498,
- 503, 507, 513, 527, 528, 532, 545, 568, 574, 579,
- 584, 594, 595, 600, 601, 605, 615, 619, 629, 630,
- 639, 657, 656, 675, 679, 683, 687, 691, 701, 710,
- 714, 719, 726, 735, 741, 747, 755, 759, 766, 765,
- 776, 777, 781, 790, 795, 803, 810, 817, 827, 836,
- 843, 852, 859, 865, 872, 882, 886, 890, 896, 900,
- 904, 908, 912, 916, 920, 932, 936, 940, 944, 954,
- 958, 965, 969, 973, 978, 983, 988, 997, 1002, 1007,
- 1013, 1019, 1030, 1034, 1038, 1050, 1063, 1071, 1083, 1084,
- 1085, 1086, 1087, 1092, 1096, 1098, 1102, 1107, 1112, 1114,
- 1116, 1118, 1120, 1122, 1124, 1133, 1144, 1146, 1148, 1153,
- 1166, 1171, 1176, 1180, 1184, 1188, 1192, 1196, 1200, 1204,
- 1206, 1209, 1213, 1219, 1222, 1231, 1237, 1242, 1243, 1244,
- 1250, 1254, 1262, 1269, 1274, 1279, 1281, 1283, 1288, 1290,
- 1295, 1296, 1298, 1313, 1317, 1323, 1329, 1335, 1341, 1347,
- 1354, 1356, 1358, 1361
+ 503, 507, 513, 533, 534, 538, 551, 574, 580, 585,
+ 590, 600, 601, 606, 607, 611, 621, 625, 635, 636,
+ 645, 663, 662, 681, 685, 689, 693, 697, 707, 716,
+ 720, 725, 732, 741, 747, 753, 761, 765, 772, 771,
+ 782, 783, 787, 796, 801, 809, 816, 823, 833, 842,
+ 849, 858, 865, 871, 878, 888, 892, 896, 902, 906,
+ 910, 914, 918, 922, 926, 938, 942, 946, 950, 960,
+ 964, 971, 975, 979, 984, 989, 994, 1003, 1008, 1013,
+ 1019, 1025, 1036, 1040, 1044, 1056, 1069, 1077, 1089, 1090,
+ 1091, 1092, 1093, 1098, 1102, 1104, 1108, 1113, 1118, 1120,
+ 1122, 1124, 1126, 1128, 1130, 1139, 1150, 1152, 1154, 1159,
+ 1172, 1177, 1182, 1186, 1190, 1194, 1198, 1202, 1206, 1210,
+ 1212, 1215, 1219, 1225, 1228, 1237, 1243, 1248, 1249, 1250,
+ 1256, 1260, 1268, 1275, 1280, 1285, 1287, 1289, 1294, 1296,
+ 1301, 1302, 1304, 1319, 1323, 1329, 1335, 1341, 1347, 1353,
+ 1360, 1362, 1364, 1367
};
#endif
diff --git a/perly.y b/perly.y
index 18e58758fb..a61a6b30fb 100644
--- a/perly.y
+++ b/perly.y
@@ -511,7 +511,9 @@ peg : PEG
;
format : FORMAT startformsub formname block
- { SvREFCNT_inc_simple_void(PL_compcv);
+ {
+ CV *fmtcv = PL_compcv;
+ SvREFCNT_inc_simple_void(PL_compcv);
#ifdef MAD
$$ = newFORM($2, $3, $4);
prepend_madprops($1->tk_mad, $$, 'F');
@@ -521,6 +523,10 @@ format : FORMAT startformsub formname block
newFORM($2, $3, $4);
$$ = (OP*)NULL;
#endif
+ if (CvOUTSIDE(fmtcv) && !CvUNIQUE(CvOUTSIDE(fmtcv))) {
+ SvREFCNT_inc_simple_void(fmtcv);
+ pad_add_anon((SV*)fmtcv, OP_NULL);
+ }
}
;
diff --git a/t/comp/form_scope.t b/t/comp/form_scope.t
new file mode 100644
index 0000000000..3ef891e13f
--- /dev/null
+++ b/t/comp/form_scope.t
@@ -0,0 +1,18 @@
+#!./perl
+#
+# Tests bug #22977. Test case from Dave Mitchell.
+
+print "1..2\n";
+
+sub f ($);
+sub f ($) {
+my $test = $_[0];
+write;
+format STDOUT =
+ok @<<<<<<<
+$test
+.
+}
+
+f(1);
+f(2);