From: Dave Mitchell Date: Sun, 13 May 2007 01:17:42 +0000 (+0000) Subject: fix some (mostly MAD) compiler warnings X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=035e2bcc0535c60f40214acc38bb076a74774dd2;p=p5sagit%2Fp5-mst-13.2.git fix some (mostly MAD) compiler warnings p4raw-id: //depot/perl@31209 --- diff --git a/perly.act b/perly.act index 25568e4..997c96c 100644 --- a/perly.act +++ b/perly.act @@ -115,7 +115,7 @@ case 2: { (yyval.opval) = newSTATEOP(0, PVAL((ps[(1) - (3)].val.p_tkval)), (ps[(2) - (3)].val.opval)); PL_parser->expect = XSTATE; - DO_MAD( + DO_MAD({ /* sideff might already have a nexstate */ OP* op = ((LISTOP*)(yyval.opval))->op_first; if (op) { @@ -125,7 +125,7 @@ case 2: token_getmad((ps[(1) - (3)].val.p_tkval),op,'L'); token_getmad((ps[(3) - (3)].val.i_tkval),op,';'); } - ) + }) ;} break; @@ -494,16 +494,18 @@ case 2: #line 538 "perly.y" { SvREFCNT_inc_simple_void(PL_compcv); #ifdef MAD - OP* o = newSVOP(OP_ANONCODE, 0, - (SV*)newATTRSUB((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))); - (yyval.opval) = newOP(OP_NULL,0); - op_getmad(o,(yyval.opval),'&'); - op_getmad((ps[(3) - (6)].val.opval),(yyval.opval),'n'); - op_getmad((ps[(4) - (6)].val.opval),(yyval.opval),'s'); - op_getmad((ps[(5) - (6)].val.opval),(yyval.opval),'a'); - token_getmad((ps[(1) - (6)].val.i_tkval),(yyval.opval),'d'); - append_madprops((ps[(6) - (6)].val.opval)->op_madprop, (yyval.opval), 0); - (ps[(6) - (6)].val.opval)->op_madprop = 0; + { + OP* o = newSVOP(OP_ANONCODE, 0, + (SV*)newATTRSUB((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))); + (yyval.opval) = newOP(OP_NULL,0); + op_getmad(o,(yyval.opval),'&'); + op_getmad((ps[(3) - (6)].val.opval),(yyval.opval),'n'); + op_getmad((ps[(4) - (6)].val.opval),(yyval.opval),'s'); + op_getmad((ps[(5) - (6)].val.opval),(yyval.opval),'a'); + token_getmad((ps[(1) - (6)].val.i_tkval),(yyval.opval),'d'); + append_madprops((ps[(6) - (6)].val.opval)->op_madprop, (yyval.opval), 0); + (ps[(6) - (6)].val.opval)->op_madprop = 0; + } #else newATTRSUB((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)); (yyval.opval) = Nullop; @@ -512,25 +514,25 @@ case 2: break; case 66: -#line 558 "perly.y" +#line 560 "perly.y" { (yyval.ival) = start_subparse(FALSE, 0); SAVEFREESV(PL_compcv); ;} break; case 67: -#line 564 "perly.y" +#line 566 "perly.y" { (yyval.ival) = start_subparse(FALSE, CVf_ANON); SAVEFREESV(PL_compcv); ;} break; case 68: -#line 569 "perly.y" +#line 571 "perly.y" { (yyval.ival) = start_subparse(TRUE, 0); SAVEFREESV(PL_compcv); ;} break; case 69: -#line 574 "perly.y" +#line 576 "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") @@ -540,24 +542,24 @@ case 2: break; case 70: -#line 584 "perly.y" +#line 586 "perly.y" { (yyval.opval) = Nullop; ;} break; case 72: -#line 590 "perly.y" +#line 592 "perly.y" { (yyval.opval) = Nullop; ;} break; case 73: -#line 592 "perly.y" +#line 594 "perly.y" { (yyval.opval) = (ps[(2) - (2)].val.opval); TOKEN_GETMAD((ps[(1) - (2)].val.i_tkval),(yyval.opval),':'); ;} break; case 74: -#line 596 "perly.y" +#line 598 "perly.y" { (yyval.opval) = IF_MAD( newOP(OP_NULL, 0), Nullop @@ -567,14 +569,14 @@ case 2: break; case 75: -#line 606 "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 76: -#line 610 "perly.y" +#line 612 "perly.y" { (yyval.opval) = IF_MAD( newOP(OP_NULL, 0), Nullop @@ -584,12 +586,12 @@ case 2: break; case 77: -#line 619 "perly.y" +#line 621 "perly.y" { (yyval.opval) = (ps[(1) - (1)].val.opval); ;} break; case 78: -#line 620 "perly.y" +#line 622 "perly.y" { (yyval.opval) = IF_MAD( newOP(OP_NULL,0), Nullop @@ -600,7 +602,7 @@ case 2: break; case 79: -#line 630 "perly.y" +#line 632 "perly.y" { #ifdef MAD (yyval.opval) = package((ps[(2) - (3)].val.opval)); @@ -614,12 +616,12 @@ case 2: break; case 80: -#line 643 "perly.y" +#line 645 "perly.y" { CvSPECIAL_on(PL_compcv); /* It's a BEGIN {} */ ;} break; case 81: -#line 645 "perly.y" +#line 647 "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)); @@ -636,28 +638,28 @@ case 2: break; case 82: -#line 662 "perly.y" +#line 664 "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 83: -#line 666 "perly.y" +#line 668 "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 84: -#line 670 "perly.y" +#line 672 "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 86: -#line 678 "perly.y" +#line 680 "perly.y" { #ifdef MAD OP* op = newNULLLIST(); @@ -670,7 +672,7 @@ case 2: break; case 87: -#line 688 "perly.y" +#line 690 "perly.y" { OP* term = (ps[(3) - (3)].val.opval); DO_MAD( @@ -682,7 +684,7 @@ case 2: break; case 89: -#line 701 "perly.y" +#line 703 "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'); @@ -690,7 +692,7 @@ case 2: break; case 90: -#line 706 "perly.y" +#line 708 "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'); @@ -700,7 +702,7 @@ case 2: break; case 91: -#line 713 "perly.y" +#line 715 "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)), @@ -712,7 +714,7 @@ case 2: break; case 92: -#line 722 "perly.y" +#line 724 "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)))); @@ -721,7 +723,7 @@ case 2: break; case 93: -#line 728 "perly.y" +#line 730 "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)), @@ -730,7 +732,7 @@ case 2: break; case 94: -#line 734 "perly.y" +#line 736 "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)), @@ -741,14 +743,14 @@ case 2: break; case 95: -#line 742 "perly.y" +#line 744 "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 96: -#line 746 "perly.y" +#line 748 "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),'('); @@ -757,13 +759,13 @@ case 2: break; case 97: -#line 752 "perly.y" +#line 754 "perly.y" { SvREFCNT_inc_simple_void(PL_compcv); (yyval.opval) = newANONATTRSUB((ps[(2) - (3)].val.ival), 0, Nullop, (ps[(3) - (3)].val.opval)); ;} break; case 98: -#line 755 "perly.y" +#line 757 "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))); @@ -771,7 +773,7 @@ case 2: break; case 101: -#line 770 "perly.y" +#line 772 "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),'{'); @@ -781,7 +783,7 @@ case 2: break; case 102: -#line 777 "perly.y" +#line 779 "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),']'); @@ -789,7 +791,7 @@ case 2: break; case 103: -#line 782 "perly.y" +#line 784 "perly.y" { (yyval.opval) = newBINOP(OP_AELEM, 0, ref(newAVREF((ps[(1) - (5)].val.opval)),OP_RV2AV), scalar((ps[(4) - (5)].val.opval))); @@ -800,7 +802,7 @@ case 2: break; case 104: -#line 790 "perly.y" +#line 792 "perly.y" { (yyval.opval) = newBINOP(OP_AELEM, 0, ref(newAVREF((ps[(1) - (4)].val.opval)),OP_RV2AV), scalar((ps[(3) - (4)].val.opval))); @@ -810,7 +812,7 @@ case 2: break; case 105: -#line 797 "perly.y" +#line 799 "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),'{'); @@ -820,7 +822,7 @@ case 2: break; case 106: -#line 804 "perly.y" +#line 806 "perly.y" { (yyval.opval) = newBINOP(OP_HELEM, 0, ref(newHVREF((ps[(1) - (6)].val.opval)),OP_RV2HV), jmaybe((ps[(4) - (6)].val.opval))); @@ -833,7 +835,7 @@ case 2: break; case 107: -#line 814 "perly.y" +#line 816 "perly.y" { (yyval.opval) = newBINOP(OP_HELEM, 0, ref(newHVREF((ps[(1) - (5)].val.opval)),OP_RV2HV), jmaybe((ps[(3) - (5)].val.opval))); @@ -845,7 +847,7 @@ case 2: break; case 108: -#line 823 "perly.y" +#line 825 "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'); @@ -855,7 +857,7 @@ case 2: break; case 109: -#line 830 "perly.y" +#line 832 "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))))); @@ -866,7 +868,7 @@ case 2: break; case 110: -#line 839 "perly.y" +#line 841 "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))))); @@ -876,7 +878,7 @@ case 2: break; case 111: -#line 846 "perly.y" +#line 848 "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),'('); @@ -885,7 +887,7 @@ case 2: break; case 112: -#line 852 "perly.y" +#line 854 "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),')'); @@ -895,7 +897,7 @@ case 2: break; case 113: -#line 859 "perly.y" +#line 861 "perly.y" { (yyval.opval) = newSLICEOP(0, (ps[(4) - (5)].val.opval), Nullop); TOKEN_GETMAD((ps[(1) - (5)].val.i_tkval),(yyval.opval),'('); TOKEN_GETMAD((ps[(2) - (5)].val.i_tkval),(yyval.opval),')'); @@ -905,21 +907,21 @@ case 2: break; case 114: -#line 869 "perly.y" +#line 871 "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 115: -#line 873 "perly.y" +#line 875 "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 116: -#line 877 "perly.y" +#line 879 "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))); @@ -928,85 +930,85 @@ case 2: break; case 117: -#line 883 "perly.y" +#line 885 "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 118: -#line 887 "perly.y" +#line 889 "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 891 "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 120: -#line 895 "perly.y" +#line 897 "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 899 "perly.y" +#line 901 "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 903 "perly.y" +#line 905 "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 907 "perly.y" +#line 909 "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( + DO_MAD({ UNOP *op; op = (UNOP*)(yyval.opval); op = (UNOP*)op->op_first; /* get to flop */ op = (UNOP*)op->op_first; /* get to flip */ op = (UNOP*)op->op_first; /* get to range */ token_getmad((ps[(2) - (3)].val.i_tkval),(OP*)op,'o'); - ) + }) ;} break; case 124: -#line 919 "perly.y" +#line 921 "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 125: -#line 923 "perly.y" +#line 925 "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 126: -#line 927 "perly.y" +#line 929 "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 127: -#line 931 "perly.y" +#line 933 "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 @@ -1016,14 +1018,14 @@ case 2: break; case 128: -#line 941 "perly.y" +#line 943 "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 129: -#line 945 "perly.y" +#line 947 "perly.y" { (yyval.opval) = IF_MAD( newUNOP(OP_NULL, 0, (ps[(2) - (2)].val.opval)), (ps[(2) - (2)].val.opval) @@ -1033,21 +1035,21 @@ case 2: break; case 130: -#line 952 "perly.y" +#line 954 "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 131: -#line 956 "perly.y" +#line 958 "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 132: -#line 960 "perly.y" +#line 962 "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'); @@ -1055,7 +1057,7 @@ case 2: break; case 133: -#line 965 "perly.y" +#line 967 "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'); @@ -1063,7 +1065,7 @@ case 2: break; case 134: -#line 970 "perly.y" +#line 972 "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'); @@ -1071,7 +1073,7 @@ case 2: break; case 135: -#line 975 "perly.y" +#line 977 "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'); @@ -1079,7 +1081,7 @@ case 2: break; case 136: -#line 984 "perly.y" +#line 986 "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),']'); @@ -1087,7 +1089,7 @@ case 2: break; case 137: -#line 989 "perly.y" +#line 991 "perly.y" { (yyval.opval) = newANONLIST(Nullop); TOKEN_GETMAD((ps[(1) - (2)].val.i_tkval),(yyval.opval),'['); TOKEN_GETMAD((ps[(2) - (2)].val.i_tkval),(yyval.opval),']'); @@ -1095,7 +1097,7 @@ case 2: break; case 138: -#line 994 "perly.y" +#line 996 "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),';'); @@ -1104,7 +1106,7 @@ case 2: break; case 139: -#line 1000 "perly.y" +#line 1002 "perly.y" { (yyval.opval) = newANONHASH(Nullop); TOKEN_GETMAD((ps[(1) - (3)].val.i_tkval),(yyval.opval),'{'); TOKEN_GETMAD((ps[(2) - (3)].val.i_tkval),(yyval.opval),';'); @@ -1113,7 +1115,7 @@ case 2: break; case 140: -#line 1006 "perly.y" +#line 1008 "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'); @@ -1123,21 +1125,21 @@ case 2: break; case 141: -#line 1017 "perly.y" +#line 1019 "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 142: -#line 1021 "perly.y" +#line 1023 "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 143: -#line 1025 "perly.y" +#line 1027 "perly.y" { (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_SPECIAL|OPf_STACKED, prepend_elem(OP_LIST, @@ -1152,7 +1154,7 @@ case 2: break; case 144: -#line 1037 "perly.y" +#line 1039 "perly.y" { (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_SPECIAL|OPf_STACKED, append_elem(OP_LIST, @@ -1168,7 +1170,7 @@ case 2: break; case 145: -#line 1050 "perly.y" +#line 1052 "perly.y" { (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_SPECIAL|OPf_STACKED, prepend_elem(OP_LIST, scalar(newCVREF(0,scalar((ps[(2) - (4)].val.opval)))), Nullop)); dep(); @@ -1179,7 +1181,7 @@ case 2: break; case 146: -#line 1058 "perly.y" +#line 1060 "perly.y" { (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_SPECIAL|OPf_STACKED, prepend_elem(OP_LIST, (ps[(4) - (5)].val.opval), @@ -1191,7 +1193,7 @@ case 2: break; case 151: -#line 1074 "perly.y" +#line 1076 "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),':'); @@ -1199,26 +1201,26 @@ case 2: break; case 152: -#line 1079 "perly.y" +#line 1081 "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 153: -#line 1083 "perly.y" +#line 1085 "perly.y" { (yyval.opval) = (ps[(1) - (1)].val.opval); ;} break; case 154: -#line 1085 "perly.y" +#line 1087 "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 155: -#line 1089 "perly.y" +#line 1091 "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),')'); @@ -1226,7 +1228,7 @@ case 2: break; case 156: -#line 1094 "perly.y" +#line 1096 "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),')'); @@ -1234,37 +1236,37 @@ case 2: break; case 157: -#line 1099 "perly.y" +#line 1101 "perly.y" { (yyval.opval) = (ps[(1) - (1)].val.opval); ;} break; case 158: -#line 1101 "perly.y" +#line 1103 "perly.y" { (yyval.opval) = (ps[(1) - (1)].val.opval); ;} break; case 159: -#line 1103 "perly.y" +#line 1105 "perly.y" { (yyval.opval) = (ps[(1) - (1)].val.opval); ;} break; case 160: -#line 1105 "perly.y" +#line 1107 "perly.y" { (yyval.opval) = (ps[(1) - (1)].val.opval); ;} break; case 161: -#line 1107 "perly.y" +#line 1109 "perly.y" { (yyval.opval) = newUNOP(OP_AV2ARYLEN, 0, ref((ps[(1) - (1)].val.opval), OP_AV2ARYLEN));;} break; case 162: -#line 1109 "perly.y" +#line 1111 "perly.y" { (yyval.opval) = (ps[(1) - (1)].val.opval); ;} break; case 163: -#line 1111 "perly.y" +#line 1113 "perly.y" { (yyval.opval) = prepend_elem(OP_ASLICE, newOP(OP_PUSHMARK, 0), newLISTOP(OP_ASLICE, 0, @@ -1276,7 +1278,7 @@ case 2: break; case 164: -#line 1120 "perly.y" +#line 1122 "perly.y" { (yyval.opval) = prepend_elem(OP_HSLICE, newOP(OP_PUSHMARK, 0), newLISTOP(OP_HSLICE, 0, @@ -1290,17 +1292,17 @@ case 2: break; case 165: -#line 1131 "perly.y" +#line 1133 "perly.y" { (yyval.opval) = (ps[(1) - (1)].val.opval); ;} break; case 166: -#line 1133 "perly.y" +#line 1135 "perly.y" { (yyval.opval) = newUNOP(OP_ENTERSUB, 0, scalar((ps[(1) - (1)].val.opval))); ;} break; case 167: -#line 1135 "perly.y" +#line 1137 "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),')'); @@ -1308,23 +1310,23 @@ case 2: break; case 168: -#line 1140 "perly.y" +#line 1142 "perly.y" { (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_STACKED, append_elem(OP_LIST, (ps[(3) - (4)].val.opval), scalar((ps[(1) - (4)].val.opval)))); - DO_MAD( + DO_MAD({ OP* op = (yyval.opval); if (op->op_type == OP_CONST) { /* defeat const fold */ op = (OP*)op->op_madprop->mad_val; } token_getmad((ps[(2) - (4)].val.i_tkval),op,'('); token_getmad((ps[(4) - (4)].val.i_tkval),op,')'); - ) + }) ;} break; case 169: -#line 1153 "perly.y" +#line 1155 "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'); @@ -1332,7 +1334,7 @@ case 2: break; case 170: -#line 1158 "perly.y" +#line 1160 "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'); @@ -1340,74 +1342,74 @@ case 2: break; case 171: -#line 1163 "perly.y" +#line 1165 "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 172: -#line 1167 "perly.y" +#line 1169 "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 173: -#line 1171 "perly.y" +#line 1173 "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 174: -#line 1175 "perly.y" +#line 1177 "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 175: -#line 1179 "perly.y" +#line 1181 "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 1183 "perly.y" +#line 1185 "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 177: -#line 1187 "perly.y" +#line 1189 "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 178: -#line 1191 "perly.y" +#line 1193 "perly.y" { (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_STACKED, scalar((ps[(1) - (1)].val.opval))); ;} break; case 179: -#line 1193 "perly.y" +#line 1195 "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 180: -#line 1196 "perly.y" +#line 1198 "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 181: -#line 1200 "perly.y" +#line 1202 "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),'('); @@ -1416,13 +1418,13 @@ case 2: break; case 182: -#line 1206 "perly.y" +#line 1208 "perly.y" { (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_STACKED, scalar((ps[(1) - (1)].val.opval))); ;} break; case 183: -#line 1209 "perly.y" +#line 1211 "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); @@ -1434,7 +1436,7 @@ case 2: break; case 184: -#line 1218 "perly.y" +#line 1220 "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),'('); @@ -1443,7 +1445,7 @@ case 2: break; case 185: -#line 1224 "perly.y" +#line 1226 "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),')'); @@ -1451,7 +1453,7 @@ case 2: break; case 188: -#line 1234 "perly.y" +#line 1236 "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'); @@ -1462,14 +1464,14 @@ case 2: break; case 189: -#line 1242 "perly.y" +#line 1244 "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 190: -#line 1249 "perly.y" +#line 1251 "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),')'); @@ -1477,7 +1479,7 @@ case 2: break; case 191: -#line 1254 "perly.y" +#line 1256 "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),')'); @@ -1485,42 +1487,42 @@ case 2: break; case 192: -#line 1259 "perly.y" +#line 1261 "perly.y" { (yyval.opval) = (ps[(1) - (1)].val.opval); ;} break; case 193: -#line 1261 "perly.y" +#line 1263 "perly.y" { (yyval.opval) = (ps[(1) - (1)].val.opval); ;} break; case 194: -#line 1263 "perly.y" +#line 1265 "perly.y" { (yyval.opval) = (ps[(1) - (1)].val.opval); ;} break; case 195: -#line 1268 "perly.y" +#line 1270 "perly.y" { (yyval.opval) = Nullop; ;} break; case 196: -#line 1270 "perly.y" +#line 1272 "perly.y" { (yyval.opval) = (ps[(1) - (1)].val.opval); ;} break; case 197: -#line 1274 "perly.y" +#line 1276 "perly.y" { (yyval.opval) = Nullop; ;} break; case 198: -#line 1276 "perly.y" +#line 1278 "perly.y" { (yyval.opval) = (ps[(1) - (1)].val.opval); ;} break; case 199: -#line 1278 "perly.y" +#line 1280 "perly.y" { #ifdef MAD OP* op = newNULLLIST(); @@ -1534,69 +1536,69 @@ case 2: break; case 200: -#line 1293 "perly.y" +#line 1295 "perly.y" { PL_parser->in_my = 0; (yyval.opval) = my((ps[(1) - (1)].val.opval)); ;} break; case 201: -#line 1297 "perly.y" +#line 1299 "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 202: -#line 1303 "perly.y" +#line 1305 "perly.y" { (yyval.opval) = newSVREF((ps[(2) - (2)].val.opval)); TOKEN_GETMAD((ps[(1) - (2)].val.i_tkval),(yyval.opval),'$'); ;} break; case 203: -#line 1309 "perly.y" +#line 1311 "perly.y" { (yyval.opval) = newAVREF((ps[(2) - (2)].val.opval)); TOKEN_GETMAD((ps[(1) - (2)].val.i_tkval),(yyval.opval),'@'); ;} break; case 204: -#line 1315 "perly.y" +#line 1317 "perly.y" { (yyval.opval) = newHVREF((ps[(2) - (2)].val.opval)); TOKEN_GETMAD((ps[(1) - (2)].val.i_tkval),(yyval.opval),'%'); ;} break; case 205: -#line 1321 "perly.y" +#line 1323 "perly.y" { (yyval.opval) = newAVREF((ps[(2) - (2)].val.opval)); TOKEN_GETMAD((ps[(1) - (2)].val.i_tkval),(yyval.opval),'l'); ;} break; case 206: -#line 1327 "perly.y" +#line 1329 "perly.y" { (yyval.opval) = newGVREF(0,(ps[(2) - (2)].val.opval)); TOKEN_GETMAD((ps[(1) - (2)].val.i_tkval),(yyval.opval),'*'); ;} break; case 207: -#line 1334 "perly.y" +#line 1336 "perly.y" { (yyval.opval) = scalar((ps[(1) - (1)].val.opval)); ;} break; case 208: -#line 1336 "perly.y" +#line 1338 "perly.y" { (yyval.opval) = scalar((ps[(1) - (1)].val.opval)); ;} break; case 209: -#line 1338 "perly.y" +#line 1340 "perly.y" { (yyval.opval) = scope((ps[(1) - (1)].val.opval)); ;} break; case 210: -#line 1341 "perly.y" +#line 1343 "perly.y" { (yyval.opval) = (ps[(1) - (1)].val.opval); ;} break; diff --git a/perly.tab b/perly.tab index f7e3fe2..81af8e8 100644 --- a/perly.tab +++ b/perly.tab @@ -173,22 +173,22 @@ static const yytype_uint16 yyrline[] = 297, 308, 311, 317, 318, 325, 338, 350, 361, 371, 381, 413, 421, 431, 437, 438, 443, 446, 450, 455, 459, 463, 469, 478, 482, 484, 486, 488, 490, 495, - 499, 505, 519, 520, 524, 537, 558, 564, 569, 574, - 584, 585, 590, 591, 595, 605, 609, 619, 620, 629, - 643, 642, 661, 665, 669, 673, 677, 687, 696, 700, - 705, 712, 721, 727, 733, 741, 745, 752, 751, 762, - 763, 767, 776, 781, 789, 796, 803, 813, 822, 829, - 838, 845, 851, 858, 868, 872, 876, 882, 886, 890, - 894, 898, 902, 906, 918, 922, 926, 930, 940, 944, - 951, 955, 959, 964, 969, 974, 983, 988, 993, 999, - 1005, 1016, 1020, 1024, 1036, 1049, 1057, 1069, 1070, 1071, - 1072, 1073, 1078, 1082, 1084, 1088, 1093, 1098, 1100, 1102, - 1104, 1106, 1108, 1110, 1119, 1130, 1132, 1134, 1139, 1152, - 1157, 1162, 1166, 1170, 1174, 1178, 1182, 1186, 1190, 1192, - 1195, 1199, 1205, 1208, 1217, 1223, 1228, 1229, 1233, 1241, - 1248, 1253, 1258, 1260, 1262, 1267, 1269, 1274, 1275, 1277, - 1292, 1296, 1302, 1308, 1314, 1320, 1326, 1333, 1335, 1337, - 1340 + 499, 505, 519, 520, 524, 537, 560, 566, 571, 576, + 586, 587, 592, 593, 597, 607, 611, 621, 622, 631, + 645, 644, 663, 667, 671, 675, 679, 689, 698, 702, + 707, 714, 723, 729, 735, 743, 747, 754, 753, 764, + 765, 769, 778, 783, 791, 798, 805, 815, 824, 831, + 840, 847, 853, 860, 870, 874, 878, 884, 888, 892, + 896, 900, 904, 908, 920, 924, 928, 932, 942, 946, + 953, 957, 961, 966, 971, 976, 985, 990, 995, 1001, + 1007, 1018, 1022, 1026, 1038, 1051, 1059, 1071, 1072, 1073, + 1074, 1075, 1080, 1084, 1086, 1090, 1095, 1100, 1102, 1104, + 1106, 1108, 1110, 1112, 1121, 1132, 1134, 1136, 1141, 1154, + 1159, 1164, 1168, 1172, 1176, 1180, 1184, 1188, 1192, 1194, + 1197, 1201, 1207, 1210, 1219, 1225, 1230, 1231, 1235, 1243, + 1250, 1255, 1260, 1262, 1264, 1269, 1271, 1276, 1277, 1279, + 1294, 1298, 1304, 1310, 1316, 1322, 1328, 1335, 1337, 1339, + 1342 }; #endif diff --git a/perly.y b/perly.y index 9960c97..191d587 100644 --- a/perly.y +++ b/perly.y @@ -226,7 +226,7 @@ line : label cond { $$ = newSTATEOP(0, PVAL($1), $2); PL_parser->expect = XSTATE; - DO_MAD( + DO_MAD({ /* sideff might already have a nexstate */ OP* op = ((LISTOP*)$$)->op_first; if (op) { @@ -236,7 +236,7 @@ line : label cond token_getmad($1,op,'L'); token_getmad($3,op,';'); } - ) + }) } ; @@ -537,16 +537,18 @@ mysubrout: MYSUB startsub subname proto subattrlist subbody subrout : SUB startsub subname proto subattrlist subbody { SvREFCNT_inc_simple_void(PL_compcv); #ifdef MAD - OP* o = newSVOP(OP_ANONCODE, 0, - (SV*)newATTRSUB($2, $3, $4, $5, $6)); - $$ = newOP(OP_NULL,0); - op_getmad(o,$$,'&'); - op_getmad($3,$$,'n'); - op_getmad($4,$$,'s'); - op_getmad($5,$$,'a'); - token_getmad($1,$$,'d'); - append_madprops($6->op_madprop, $$, 0); - $6->op_madprop = 0; + { + OP* o = newSVOP(OP_ANONCODE, 0, + (SV*)newATTRSUB($2, $3, $4, $5, $6)); + $$ = newOP(OP_NULL,0); + op_getmad(o,$$,'&'); + op_getmad($3,$$,'n'); + op_getmad($4,$$,'s'); + op_getmad($5,$$,'a'); + token_getmad($1,$$,'d'); + append_madprops($6->op_madprop, $$, 0); + $6->op_madprop = 0; + } #else newATTRSUB($2, $3, $4, $5, $6); $$ = Nullop; @@ -906,14 +908,14 @@ termbinop: term ASSIGNOP term /* $x = $y */ | term DOTDOT term /* $x..$y, $x...$y */ { $$ = newRANGE(IVAL($2), scalar($1), scalar($3)); - DO_MAD( + DO_MAD({ UNOP *op; op = (UNOP*)$$; op = (UNOP*)op->op_first; /* get to flop */ op = (UNOP*)op->op_first; /* get to flip */ op = (UNOP*)op->op_first; /* get to range */ token_getmad($2,(OP*)op,'o'); - ) + }) } | term ANDAND term /* $x && $y */ { $$ = newLOGOP(OP_AND, 0, $1, $3); @@ -1140,14 +1142,14 @@ term : termbinop { $$ = newUNOP(OP_ENTERSUB, OPf_STACKED, append_elem(OP_LIST, $3, scalar($1))); - DO_MAD( + DO_MAD({ OP* op = $$; if (op->op_type == OP_CONST) { /* defeat const fold */ op = (OP*)op->op_madprop->mad_val; } token_getmad($2,op,'('); token_getmad($4,op,')'); - ) + }) } | NOAMP WORD listexpr /* foo(@args) */ { $$ = newUNOP(OP_ENTERSUB, OPf_STACKED, diff --git a/toke.c b/toke.c index 46862bf..6819a8e 100644 --- a/toke.c +++ b/toke.c @@ -1279,7 +1279,7 @@ S_curmad(pTHX_ char slot, SV *sv) /* keep a slot open for the head of the list? */ if (slot != '_' && *where && (*where)->mad_key == '^') { (*where)->mad_key = slot; - sv_free((*where)->mad_val); + sv_free((SV*)((*where)->mad_val)); (*where)->mad_val = (void*)sv; } else