From 2c658e55bf9e8acf7cc0207ea3db8f7064cb3ad7 Mon Sep 17 00:00:00 2001 From: Father Chrysostomos Date: Mon, 6 Aug 2012 21:59:17 -0700 Subject: [PATCH] =?utf8?q?Don=E2=80=99t=20create=20formats=20after=20compi?= =?utf8?q?lation=20errors?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Otherwise you can end up with a format that has nonsensical op tree, but it gets attached and you can call it anyway. --- op.c | 15 ++- perly.act | 361 +++++++++++++++++++++++++++++------------------------------ perly.h | 2 +- perly.tab | 44 ++++---- perly.y | 1 - t/op/write.t | 13 ++- 6 files changed, 227 insertions(+), 209 deletions(-) diff --git a/op.c b/op.c index 6cfff4f..5f19e68 100644 --- a/op.c +++ b/op.c @@ -7504,7 +7504,14 @@ Perl_newFORM(pTHX_ I32 floor, OP *o, OP *block) OP* pegop = newOP(OP_NULL, 0); #endif - GV * const gv = o + GV *gv; + + if (PL_parser && PL_parser->error_count) { + op_free(block); + goto finish; + } + + gv = o ? gv_fetchsv(cSVOPo->op_sv, GV_ADD, SVt_PVFM) : gv_fetchpvs("STDOUT", GV_ADD|GV_NOTQUAL, SVt_PVFM); @@ -7527,7 +7534,7 @@ Perl_newFORM(pTHX_ I32 floor, OP *o, OP *block) SvREFCNT_dec(cv); } cv = PL_compcv; - GvFORM(gv) = cv; + GvFORM(gv) = (CV *)SvREFCNT_inc_simple_NN(cv); CvGV_set(cv, gv); CvFILE_set_from_cop(cv, PL_curcop); @@ -7540,13 +7547,15 @@ Perl_newFORM(pTHX_ I32 floor, OP *o, OP *block) CvROOT(cv)->op_next = 0; CALL_PEEP(CvSTART(cv)); finalize_optree(CvROOT(cv)); + cv_forget_slab(cv); + + finish: #ifdef PERL_MAD op_getmad(o,pegop,'n'); op_getmad_weak(block, pegop, 'b'); #else op_free(o); #endif - cv_forget_slab(cv); if (PL_parser) PL_parser->copline = NOLINE; LEAVE_SCOPE(floor); diff --git a/perly.act b/perly.act index 9b39e92..d88e7ed 100644 --- a/perly.act +++ b/perly.act @@ -209,7 +209,6 @@ case 2: #line 289 "perly.y" { 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'); @@ -227,7 +226,7 @@ case 2: break; case 28: -#line 307 "perly.y" +#line 306 "perly.y" { SvREFCNT_inc_simple_void(PL_compcv); #ifdef MAD @@ -251,7 +250,7 @@ case 2: break; case 29: -#line 328 "perly.y" +#line 327 "perly.y" { /* Unimplemented "my sub foo { }" */ SvREFCNT_inc_simple_void(PL_compcv); @@ -266,7 +265,7 @@ case 2: break; case 30: -#line 340 "perly.y" +#line 339 "perly.y" { #ifdef MAD (yyval.opval) = package((ps[(3) - (4)].val.opval)); @@ -284,12 +283,12 @@ case 2: break; case 31: -#line 355 "perly.y" +#line 354 "perly.y" { CvSPECIAL_on(PL_compcv); /* It's a BEGIN {} */ ;} break; case 32: -#line 357 "perly.y" +#line 356 "perly.y" { SvREFCNT_inc_simple_void(PL_compcv); #ifdef MAD @@ -307,7 +306,7 @@ case 2: break; case 33: -#line 372 "perly.y" +#line 371 "perly.y" { (yyval.opval) = block_end((ps[(3) - (7)].val.ival), newCONDOP(0, (ps[(4) - (7)].val.opval), op_scope((ps[(6) - (7)].val.opval)), (ps[(7) - (7)].val.opval))); @@ -319,7 +318,7 @@ case 2: break; case 34: -#line 381 "perly.y" +#line 380 "perly.y" { (yyval.opval) = block_end((ps[(3) - (7)].val.ival), newCONDOP(0, (ps[(4) - (7)].val.opval), op_scope((ps[(6) - (7)].val.opval)), (ps[(7) - (7)].val.opval))); @@ -331,7 +330,7 @@ case 2: break; case 35: -#line 390 "perly.y" +#line 389 "perly.y" { const PADOFFSET offset = pad_findmy_pvs("$_", 0); (yyval.opval) = block_end((ps[(3) - (6)].val.ival), @@ -345,17 +344,17 @@ case 2: break; case 36: -#line 401 "perly.y" +#line 400 "perly.y" { (yyval.opval) = block_end((ps[(3) - (6)].val.ival), newWHENOP((ps[(4) - (6)].val.opval), op_scope((ps[(6) - (6)].val.opval)))); ;} break; case 37: -#line 403 "perly.y" +#line 402 "perly.y" { (yyval.opval) = newWHENOP(0, op_scope((ps[(2) - (2)].val.opval))); ;} break; case 38: -#line 405 "perly.y" +#line 404 "perly.y" { (yyval.opval) = block_end((ps[(3) - (8)].val.ival), newWHILEOP(0, 1, (LOOP*)(OP*)NULL, @@ -368,7 +367,7 @@ case 2: break; case 39: -#line 415 "perly.y" +#line 414 "perly.y" { (yyval.opval) = block_end((ps[(3) - (8)].val.ival), newWHILEOP(0, 1, (LOOP*)(OP*)NULL, @@ -381,7 +380,7 @@ case 2: break; case 40: -#line 426 "perly.y" +#line 425 "perly.y" { OP *initop = IF_MAD((ps[(4) - (11)].val.opval) ? (ps[(4) - (11)].val.opval) : newOP(OP_NULL, 0), (ps[(4) - (11)].val.opval)); OP *forop = newWHILEOP(0, 1, (LOOP*)(OP*)NULL, @@ -404,7 +403,7 @@ case 2: break; case 41: -#line 446 "perly.y" +#line 445 "perly.y" { (yyval.opval) = block_end((ps[(3) - (9)].val.ival), newFOROP(0, (ps[(4) - (9)].val.opval), (ps[(6) - (9)].val.opval), (ps[(8) - (9)].val.opval), (ps[(9) - (9)].val.opval))); TOKEN_GETMAD((ps[(1) - (9)].val.i_tkval),(yyval.opval),'W'); @@ -416,7 +415,7 @@ case 2: break; case 42: -#line 455 "perly.y" +#line 454 "perly.y" { (yyval.opval) = block_end((ps[(4) - (8)].val.ival), newFOROP(0, op_lvalue((ps[(2) - (8)].val.opval), OP_ENTERLOOP), (ps[(5) - (8)].val.opval), (ps[(7) - (8)].val.opval), (ps[(8) - (8)].val.opval))); @@ -428,7 +427,7 @@ case 2: break; case 43: -#line 464 "perly.y" +#line 463 "perly.y" { (yyval.opval) = block_end((ps[(3) - (7)].val.ival), newFOROP(0, (OP*)NULL, (ps[(4) - (7)].val.opval), (ps[(6) - (7)].val.opval), (ps[(7) - (7)].val.opval))); @@ -440,7 +439,7 @@ case 2: break; case 44: -#line 473 "perly.y" +#line 472 "perly.y" { /* a block is a loop that happens once */ (yyval.opval) = newWHILEOP(0, 1, (LOOP*)(OP*)NULL, @@ -449,7 +448,7 @@ case 2: break; case 45: -#line 479 "perly.y" +#line 478 "perly.y" { package((ps[(3) - (5)].val.opval)); if ((ps[(2) - (5)].val.opval)) { @@ -459,7 +458,7 @@ case 2: break; case 46: -#line 486 "perly.y" +#line 485 "perly.y" { /* a block is a loop that happens once */ (yyval.opval) = newWHILEOP(0, 1, (LOOP*)(OP*)NULL, @@ -472,7 +471,7 @@ case 2: break; case 47: -#line 496 "perly.y" +#line 495 "perly.y" { PL_parser->expect = XSTATE; (yyval.opval) = (ps[(1) - (2)].val.opval); @@ -481,7 +480,7 @@ case 2: break; case 48: -#line 502 "perly.y" +#line 501 "perly.y" { PL_parser->expect = XSTATE; (yyval.opval) = IF_MAD(newOP(OP_NULL, 0), (OP*)NULL); @@ -491,45 +490,45 @@ case 2: break; case 49: -#line 512 "perly.y" +#line 511 "perly.y" { (yyval.opval) = (OP*)NULL; ;} break; case 50: -#line 514 "perly.y" +#line 513 "perly.y" { (yyval.opval) = (ps[(1) - (1)].val.opval); ;} break; case 51: -#line 516 "perly.y" +#line 515 "perly.y" { (yyval.opval) = newLOGOP(OP_AND, 0, (ps[(3) - (3)].val.opval), (ps[(1) - (3)].val.opval)); TOKEN_GETMAD((ps[(2) - (3)].val.i_tkval),(yyval.opval),'i'); ;} break; case 52: -#line 520 "perly.y" +#line 519 "perly.y" { (yyval.opval) = newLOGOP(OP_OR, 0, (ps[(3) - (3)].val.opval), (ps[(1) - (3)].val.opval)); TOKEN_GETMAD((ps[(2) - (3)].val.i_tkval),(yyval.opval),'i'); ;} break; case 53: -#line 524 "perly.y" +#line 523 "perly.y" { (yyval.opval) = newLOOPOP(OPf_PARENS, 1, scalar((ps[(3) - (3)].val.opval)), (ps[(1) - (3)].val.opval)); TOKEN_GETMAD((ps[(2) - (3)].val.i_tkval),(yyval.opval),'w'); ;} break; case 54: -#line 528 "perly.y" +#line 527 "perly.y" { (yyval.opval) = newLOOPOP(OPf_PARENS, 1, (ps[(3) - (3)].val.opval), (ps[(1) - (3)].val.opval)); TOKEN_GETMAD((ps[(2) - (3)].val.i_tkval),(yyval.opval),'w'); ;} break; case 55: -#line 532 "perly.y" +#line 531 "perly.y" { (yyval.opval) = newFOROP(0, (OP*)NULL, (ps[(3) - (3)].val.opval), (ps[(1) - (3)].val.opval), (OP*)NULL); TOKEN_GETMAD((ps[(2) - (3)].val.i_tkval),(yyval.opval),'w'); PL_parser->copline = (line_t)IVAL((ps[(2) - (3)].val.i_tkval)); @@ -537,17 +536,17 @@ case 2: break; case 56: -#line 537 "perly.y" +#line 536 "perly.y" { (yyval.opval) = newWHENOP((ps[(3) - (3)].val.opval), op_scope((ps[(1) - (3)].val.opval))); ;} break; case 57: -#line 542 "perly.y" +#line 541 "perly.y" { (yyval.opval) = (OP*)NULL; ;} break; case 58: -#line 544 "perly.y" +#line 543 "perly.y" { ((ps[(2) - (2)].val.opval))->op_flags |= OPf_PARENS; (yyval.opval) = op_scope((ps[(2) - (2)].val.opval)); @@ -556,7 +555,7 @@ case 2: break; case 59: -#line 550 "perly.y" +#line 549 "perly.y" { PL_parser->copline = (line_t)IVAL((ps[(1) - (6)].val.i_tkval)); (yyval.opval) = newCONDOP(0, newSTATEOP(OPf_SPECIAL,NULL,(ps[(3) - (6)].val.opval)), @@ -569,12 +568,12 @@ case 2: break; case 60: -#line 563 "perly.y" +#line 562 "perly.y" { (yyval.opval) = (OP*)NULL; ;} break; case 61: -#line 565 "perly.y" +#line 564 "perly.y" { (yyval.opval) = op_scope((ps[(2) - (2)].val.opval)); TOKEN_GETMAD((ps[(1) - (2)].val.i_tkval),(yyval.opval),'o'); @@ -582,74 +581,74 @@ case 2: break; case 62: -#line 573 "perly.y" +#line 572 "perly.y" { (yyval.ival) = (PL_min_intro_pending && PL_max_intro_pending >= PL_min_intro_pending); intro_my(); ;} break; case 63: -#line 579 "perly.y" +#line 578 "perly.y" { (yyval.opval) = (OP*)NULL; ;} break; case 65: -#line 585 "perly.y" +#line 584 "perly.y" { YYSTYPE tmplval; (void)scan_num("1", &tmplval); (yyval.opval) = tmplval.opval; ;} break; case 67: -#line 593 "perly.y" +#line 592 "perly.y" { (yyval.opval) = invert(scalar((ps[(1) - (1)].val.opval))); ;} break; case 68: -#line 598 "perly.y" +#line 597 "perly.y" { (yyval.opval) = (ps[(1) - (1)].val.opval); intro_my(); ;} break; case 69: -#line 602 "perly.y" +#line 601 "perly.y" { (yyval.opval) = (ps[(1) - (1)].val.opval); intro_my(); ;} break; case 70: -#line 606 "perly.y" +#line 605 "perly.y" { (yyval.opval) = (ps[(1) - (1)].val.opval); intro_my(); ;} break; case 71: -#line 609 "perly.y" +#line 608 "perly.y" { (yyval.opval) = (ps[(1) - (1)].val.opval); ;} break; case 72: -#line 610 "perly.y" +#line 609 "perly.y" { (yyval.opval) = (OP*)NULL; ;} break; case 73: -#line 614 "perly.y" +#line 613 "perly.y" { (yyval.ival) = start_subparse(FALSE, 0); SAVEFREESV(PL_compcv); ;} break; case 74: -#line 620 "perly.y" +#line 619 "perly.y" { (yyval.ival) = start_subparse(FALSE, CVf_ANON); SAVEFREESV(PL_compcv); ;} break; case 75: -#line 625 "perly.y" +#line 624 "perly.y" { (yyval.ival) = start_subparse(TRUE, 0); SAVEFREESV(PL_compcv); ;} break; case 76: -#line 630 "perly.y" +#line 629 "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") @@ -659,24 +658,24 @@ case 2: break; case 77: -#line 640 "perly.y" +#line 639 "perly.y" { (yyval.opval) = (OP*)NULL; ;} break; case 79: -#line 646 "perly.y" +#line 645 "perly.y" { (yyval.opval) = (OP*)NULL; ;} break; case 80: -#line 648 "perly.y" +#line 647 "perly.y" { (yyval.opval) = (ps[(2) - (2)].val.opval); TOKEN_GETMAD((ps[(1) - (2)].val.i_tkval),(yyval.opval),':'); ;} break; case 81: -#line 652 "perly.y" +#line 651 "perly.y" { (yyval.opval) = IF_MAD( newOP(OP_NULL, 0), (OP*)NULL @@ -686,14 +685,14 @@ case 2: break; case 82: -#line 662 "perly.y" +#line 661 "perly.y" { (yyval.opval) = (ps[(2) - (2)].val.opval); TOKEN_GETMAD((ps[(1) - (2)].val.i_tkval),(yyval.opval),':'); ;} break; case 83: -#line 666 "perly.y" +#line 665 "perly.y" { (yyval.opval) = IF_MAD( newOP(OP_NULL, 0), (OP*)NULL @@ -703,12 +702,12 @@ case 2: break; case 84: -#line 675 "perly.y" +#line 674 "perly.y" { (yyval.opval) = (ps[(1) - (1)].val.opval); ;} break; case 85: -#line 676 "perly.y" +#line 675 "perly.y" { (yyval.opval) = IF_MAD( newOP(OP_NULL,0), (OP*)NULL @@ -719,28 +718,28 @@ case 2: break; case 86: -#line 687 "perly.y" +#line 686 "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 87: -#line 691 "perly.y" +#line 690 "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 88: -#line 695 "perly.y" +#line 694 "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 90: -#line 703 "perly.y" +#line 702 "perly.y" { #ifdef MAD OP* op = newNULLLIST(); @@ -753,7 +752,7 @@ case 2: break; case 91: -#line 713 "perly.y" +#line 712 "perly.y" { OP* term = (ps[(3) - (3)].val.opval); DO_MAD( @@ -765,7 +764,7 @@ case 2: break; case 93: -#line 726 "perly.y" +#line 725 "perly.y" { (yyval.opval) = convert(IVAL((ps[(1) - (3)].val.i_tkval)), OPf_STACKED, op_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'); @@ -773,7 +772,7 @@ case 2: break; case 94: -#line 731 "perly.y" +#line 730 "perly.y" { (yyval.opval) = convert(IVAL((ps[(1) - (5)].val.i_tkval)), OPf_STACKED, op_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'); @@ -783,7 +782,7 @@ case 2: break; case 95: -#line 738 "perly.y" +#line 737 "perly.y" { (yyval.opval) = convert(OP_ENTERSUB, OPf_STACKED, op_append_elem(OP_LIST, op_prepend_elem(OP_LIST, scalar((ps[(1) - (6)].val.opval)), (ps[(5) - (6)].val.opval)), @@ -795,7 +794,7 @@ case 2: break; case 96: -#line 747 "perly.y" +#line 746 "perly.y" { (yyval.opval) = convert(OP_ENTERSUB, OPf_STACKED, op_append_elem(OP_LIST, scalar((ps[(1) - (3)].val.opval)), newUNOP(OP_METHOD, 0, (ps[(3) - (3)].val.opval)))); @@ -804,7 +803,7 @@ case 2: break; case 97: -#line 753 "perly.y" +#line 752 "perly.y" { (yyval.opval) = convert(OP_ENTERSUB, OPf_STACKED, op_append_elem(OP_LIST, op_prepend_elem(OP_LIST, (ps[(2) - (3)].val.opval), (ps[(3) - (3)].val.opval)), @@ -813,7 +812,7 @@ case 2: break; case 98: -#line 759 "perly.y" +#line 758 "perly.y" { (yyval.opval) = convert(OP_ENTERSUB, OPf_STACKED, op_append_elem(OP_LIST, op_prepend_elem(OP_LIST, (ps[(2) - (5)].val.opval), (ps[(4) - (5)].val.opval)), @@ -824,14 +823,14 @@ case 2: break; case 99: -#line 767 "perly.y" +#line 766 "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 100: -#line 771 "perly.y" +#line 770 "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),'('); @@ -840,13 +839,13 @@ case 2: break; case 101: -#line 777 "perly.y" +#line 776 "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 102: -#line 780 "perly.y" +#line 779 "perly.y" { (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_STACKED, op_append_elem(OP_LIST, op_prepend_elem(OP_LIST, (ps[(4) - (5)].val.opval), (ps[(5) - (5)].val.opval)), (ps[(1) - (5)].val.opval))); @@ -854,7 +853,7 @@ case 2: break; case 105: -#line 795 "perly.y" +#line 794 "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),'{'); @@ -864,7 +863,7 @@ case 2: break; case 106: -#line 802 "perly.y" +#line 801 "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),']'); @@ -872,7 +871,7 @@ case 2: break; case 107: -#line 807 "perly.y" +#line 806 "perly.y" { (yyval.opval) = newBINOP(OP_AELEM, 0, ref(newAVREF((ps[(1) - (5)].val.opval)),OP_RV2AV), scalar((ps[(4) - (5)].val.opval))); @@ -883,7 +882,7 @@ case 2: break; case 108: -#line 815 "perly.y" +#line 814 "perly.y" { (yyval.opval) = newBINOP(OP_AELEM, 0, ref(newAVREF((ps[(1) - (4)].val.opval)),OP_RV2AV), scalar((ps[(3) - (4)].val.opval))); @@ -893,7 +892,7 @@ case 2: break; case 109: -#line 822 "perly.y" +#line 821 "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),'{'); @@ -903,7 +902,7 @@ case 2: break; case 110: -#line 829 "perly.y" +#line 828 "perly.y" { (yyval.opval) = newBINOP(OP_HELEM, 0, ref(newHVREF((ps[(1) - (6)].val.opval)),OP_RV2HV), jmaybe((ps[(4) - (6)].val.opval))); @@ -916,7 +915,7 @@ case 2: break; case 111: -#line 839 "perly.y" +#line 838 "perly.y" { (yyval.opval) = newBINOP(OP_HELEM, 0, ref(newHVREF((ps[(1) - (5)].val.opval)),OP_RV2HV), jmaybe((ps[(3) - (5)].val.opval))); @@ -928,7 +927,7 @@ case 2: break; case 112: -#line 848 "perly.y" +#line 847 "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'); @@ -938,7 +937,7 @@ case 2: break; case 113: -#line 855 "perly.y" +#line 854 "perly.y" { (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_STACKED, op_append_elem(OP_LIST, (ps[(4) - (5)].val.opval), newCVREF(0, scalar((ps[(1) - (5)].val.opval))))); @@ -949,7 +948,7 @@ case 2: break; case 114: -#line 864 "perly.y" +#line 863 "perly.y" { (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_STACKED, op_append_elem(OP_LIST, (ps[(3) - (4)].val.opval), newCVREF(0, scalar((ps[(1) - (4)].val.opval))))); @@ -959,7 +958,7 @@ case 2: break; case 115: -#line 871 "perly.y" +#line 870 "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),'('); @@ -968,7 +967,7 @@ case 2: break; case 116: -#line 877 "perly.y" +#line 876 "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),')'); @@ -978,7 +977,7 @@ case 2: break; case 117: -#line 884 "perly.y" +#line 883 "perly.y" { (yyval.opval) = newSLICEOP(0, (ps[(3) - (4)].val.opval), (ps[(1) - (4)].val.opval)); TOKEN_GETMAD((ps[(2) - (4)].val.i_tkval),(yyval.opval),'['); TOKEN_GETMAD((ps[(4) - (4)].val.i_tkval),(yyval.opval),']'); @@ -986,7 +985,7 @@ case 2: break; case 118: -#line 889 "perly.y" +#line 888 "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),')'); @@ -996,21 +995,21 @@ case 2: break; case 119: -#line 899 "perly.y" +#line 898 "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 120: -#line 903 "perly.y" +#line 902 "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 907 "perly.y" +#line 906 "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))); @@ -1019,49 +1018,49 @@ case 2: break; case 122: -#line 913 "perly.y" +#line 912 "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 916 "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 920 "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 125: -#line 925 "perly.y" +#line 924 "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 126: -#line 929 "perly.y" +#line 928 "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 127: -#line 933 "perly.y" +#line 932 "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 128: -#line 937 "perly.y" +#line 936 "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({ @@ -1076,28 +1075,28 @@ case 2: break; case 129: -#line 949 "perly.y" +#line 948 "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 130: -#line 953 "perly.y" +#line 952 "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 131: -#line 957 "perly.y" +#line 956 "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 132: -#line 961 "perly.y" +#line 960 "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 @@ -1107,14 +1106,14 @@ case 2: break; case 133: -#line 971 "perly.y" +#line 970 "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 134: -#line 975 "perly.y" +#line 974 "perly.y" { (yyval.opval) = IF_MAD( newUNOP(OP_NULL, 0, (ps[(2) - (2)].val.opval)), (ps[(2) - (2)].val.opval) @@ -1124,21 +1123,21 @@ case 2: break; case 135: -#line 982 "perly.y" +#line 981 "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 136: -#line 986 "perly.y" +#line 985 "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 137: -#line 990 "perly.y" +#line 989 "perly.y" { (yyval.opval) = newUNOP(OP_POSTINC, 0, op_lvalue(scalar((ps[(1) - (2)].val.opval)), OP_POSTINC)); TOKEN_GETMAD((ps[(2) - (2)].val.i_tkval),(yyval.opval),'o'); @@ -1146,7 +1145,7 @@ case 2: break; case 138: -#line 995 "perly.y" +#line 994 "perly.y" { (yyval.opval) = newUNOP(OP_POSTDEC, 0, op_lvalue(scalar((ps[(1) - (2)].val.opval)), OP_POSTDEC)); TOKEN_GETMAD((ps[(2) - (2)].val.i_tkval),(yyval.opval),'o'); @@ -1154,7 +1153,7 @@ case 2: break; case 139: -#line 1000 "perly.y" +#line 999 "perly.y" { (yyval.opval) = newUNOP(OP_PREINC, 0, op_lvalue(scalar((ps[(2) - (2)].val.opval)), OP_PREINC)); TOKEN_GETMAD((ps[(1) - (2)].val.i_tkval),(yyval.opval),'o'); @@ -1162,7 +1161,7 @@ case 2: break; case 140: -#line 1005 "perly.y" +#line 1004 "perly.y" { (yyval.opval) = newUNOP(OP_PREDEC, 0, op_lvalue(scalar((ps[(2) - (2)].val.opval)), OP_PREDEC)); TOKEN_GETMAD((ps[(1) - (2)].val.i_tkval),(yyval.opval),'o'); @@ -1170,7 +1169,7 @@ case 2: break; case 141: -#line 1014 "perly.y" +#line 1013 "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),']'); @@ -1178,7 +1177,7 @@ case 2: break; case 142: -#line 1019 "perly.y" +#line 1018 "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),']'); @@ -1186,7 +1185,7 @@ case 2: break; case 143: -#line 1024 "perly.y" +#line 1023 "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),';'); @@ -1195,7 +1194,7 @@ case 2: break; case 144: -#line 1030 "perly.y" +#line 1029 "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),';'); @@ -1204,7 +1203,7 @@ case 2: break; case 145: -#line 1036 "perly.y" +#line 1035 "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'); @@ -1214,21 +1213,21 @@ case 2: break; case 146: -#line 1047 "perly.y" +#line 1046 "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 147: -#line 1051 "perly.y" +#line 1050 "perly.y" { (yyval.opval) = newUNOP(OP_NULL, OPf_SPECIAL, op_scope((ps[(2) - (2)].val.opval))); TOKEN_GETMAD((ps[(1) - (2)].val.i_tkval),(yyval.opval),'D'); ;} break; case 148: -#line 1055 "perly.y" +#line 1054 "perly.y" { (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_SPECIAL|OPf_STACKED, op_prepend_elem(OP_LIST, @@ -1243,7 +1242,7 @@ case 2: break; case 149: -#line 1067 "perly.y" +#line 1066 "perly.y" { (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_SPECIAL|OPf_STACKED, op_append_elem(OP_LIST, @@ -1259,7 +1258,7 @@ case 2: break; case 150: -#line 1080 "perly.y" +#line 1079 "perly.y" { (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_SPECIAL|OPf_STACKED, op_prepend_elem(OP_LIST, scalar(newCVREF(0,scalar((ps[(2) - (4)].val.opval)))), (OP*)NULL)); dep(); @@ -1270,7 +1269,7 @@ case 2: break; case 151: -#line 1088 "perly.y" +#line 1087 "perly.y" { (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_SPECIAL|OPf_STACKED, op_prepend_elem(OP_LIST, (ps[(4) - (5)].val.opval), @@ -1282,7 +1281,7 @@ case 2: break; case 156: -#line 1104 "perly.y" +#line 1103 "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),':'); @@ -1290,26 +1289,26 @@ case 2: break; case 157: -#line 1109 "perly.y" +#line 1108 "perly.y" { (yyval.opval) = newUNOP(OP_REFGEN, 0, op_lvalue((ps[(2) - (2)].val.opval),OP_REFGEN)); TOKEN_GETMAD((ps[(1) - (2)].val.i_tkval),(yyval.opval),'o'); ;} break; case 158: -#line 1113 "perly.y" +#line 1112 "perly.y" { (yyval.opval) = (ps[(1) - (1)].val.opval); ;} break; case 159: -#line 1115 "perly.y" +#line 1114 "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 160: -#line 1119 "perly.y" +#line 1118 "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),')'); @@ -1317,12 +1316,12 @@ case 2: break; case 161: -#line 1124 "perly.y" +#line 1123 "perly.y" { (yyval.opval) = IF_MAD(newUNOP(OP_NULL,0,(ps[(1) - (1)].val.opval)), (ps[(1) - (1)].val.opval)); ;} break; case 162: -#line 1126 "perly.y" +#line 1125 "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),')'); @@ -1330,37 +1329,37 @@ case 2: break; case 163: -#line 1131 "perly.y" +#line 1130 "perly.y" { (yyval.opval) = (ps[(1) - (1)].val.opval); ;} break; case 164: -#line 1133 "perly.y" +#line 1132 "perly.y" { (yyval.opval) = (ps[(1) - (1)].val.opval); ;} break; case 165: -#line 1135 "perly.y" +#line 1134 "perly.y" { (yyval.opval) = (ps[(1) - (1)].val.opval); ;} break; case 166: -#line 1137 "perly.y" +#line 1136 "perly.y" { (yyval.opval) = (ps[(1) - (1)].val.opval); ;} break; case 167: -#line 1139 "perly.y" +#line 1138 "perly.y" { (yyval.opval) = newUNOP(OP_AV2ARYLEN, 0, ref((ps[(1) - (1)].val.opval), OP_AV2ARYLEN));;} break; case 168: -#line 1141 "perly.y" +#line 1140 "perly.y" { (yyval.opval) = (ps[(1) - (1)].val.opval); ;} break; case 169: -#line 1143 "perly.y" +#line 1142 "perly.y" { (yyval.opval) = op_prepend_elem(OP_ASLICE, newOP(OP_PUSHMARK, 0), newLISTOP(OP_ASLICE, 0, @@ -1372,7 +1371,7 @@ case 2: break; case 170: -#line 1152 "perly.y" +#line 1151 "perly.y" { (yyval.opval) = op_prepend_elem(OP_HSLICE, newOP(OP_PUSHMARK, 0), newLISTOP(OP_HSLICE, 0, @@ -1386,17 +1385,17 @@ case 2: break; case 171: -#line 1163 "perly.y" +#line 1162 "perly.y" { (yyval.opval) = (ps[(1) - (1)].val.opval); ;} break; case 172: -#line 1165 "perly.y" +#line 1164 "perly.y" { (yyval.opval) = newUNOP(OP_ENTERSUB, 0, scalar((ps[(1) - (1)].val.opval))); ;} break; case 173: -#line 1167 "perly.y" +#line 1166 "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),')'); @@ -1404,7 +1403,7 @@ case 2: break; case 174: -#line 1172 "perly.y" +#line 1171 "perly.y" { (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_STACKED, op_append_elem(OP_LIST, (ps[(3) - (4)].val.opval), scalar((ps[(1) - (4)].val.opval)))); @@ -1420,7 +1419,7 @@ case 2: break; case 175: -#line 1185 "perly.y" +#line 1184 "perly.y" { (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_STACKED, op_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'); @@ -1428,7 +1427,7 @@ case 2: break; case 176: -#line 1190 "perly.y" +#line 1189 "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'); @@ -1436,74 +1435,74 @@ case 2: break; case 177: -#line 1195 "perly.y" +#line 1194 "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 178: -#line 1199 "perly.y" +#line 1198 "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 179: -#line 1203 "perly.y" +#line 1202 "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 180: -#line 1207 "perly.y" +#line 1206 "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 181: -#line 1211 "perly.y" +#line 1210 "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 182: -#line 1215 "perly.y" +#line 1214 "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 183: -#line 1219 "perly.y" +#line 1218 "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 184: -#line 1223 "perly.y" +#line 1222 "perly.y" { (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_STACKED, scalar((ps[(1) - (1)].val.opval))); ;} break; case 185: -#line 1225 "perly.y" +#line 1224 "perly.y" { (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_STACKED, op_append_elem(OP_LIST, (ps[(2) - (2)].val.opval), scalar((ps[(1) - (2)].val.opval)))); ;} break; case 186: -#line 1228 "perly.y" +#line 1227 "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 187: -#line 1232 "perly.y" +#line 1231 "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),'('); @@ -1512,12 +1511,12 @@ case 2: break; case 188: -#line 1238 "perly.y" +#line 1237 "perly.y" { (yyval.opval) = (ps[(1) - (1)].val.opval); ;} break; case 189: -#line 1240 "perly.y" +#line 1239 "perly.y" { (yyval.opval) = (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),')'); @@ -1525,13 +1524,13 @@ case 2: break; case 190: -#line 1245 "perly.y" +#line 1244 "perly.y" { (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_STACKED, scalar((ps[(1) - (1)].val.opval))); ;} break; case 191: -#line 1248 "perly.y" +#line 1247 "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); @@ -1543,7 +1542,7 @@ case 2: break; case 192: -#line 1257 "perly.y" +#line 1256 "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),'('); @@ -1552,7 +1551,7 @@ case 2: break; case 193: -#line 1263 "perly.y" +#line 1262 "perly.y" { if ( (ps[(1) - (1)].val.opval)->op_type != OP_TRANS && (ps[(1) - (1)].val.opval)->op_type != OP_TRANSR @@ -1566,7 +1565,7 @@ case 2: break; case 194: -#line 1274 "perly.y" +#line 1273 "perly.y" { (yyval.opval) = pmruntime((ps[(1) - (5)].val.opval), (ps[(4) - (5)].val.opval), 1, (ps[(2) - (5)].val.ival)); TOKEN_GETMAD((ps[(3) - (5)].val.i_tkval),(yyval.opval),'('); TOKEN_GETMAD((ps[(5) - (5)].val.i_tkval),(yyval.opval),')'); @@ -1574,7 +1573,7 @@ case 2: break; case 197: -#line 1281 "perly.y" +#line 1280 "perly.y" { (yyval.opval) = newLISTOP(OP_DIE, 0, newOP(OP_PUSHMARK, 0), newSVOP(OP_CONST, 0, newSVpvs("Unimplemented"))); @@ -1583,7 +1582,7 @@ case 2: break; case 199: -#line 1291 "perly.y" +#line 1290 "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'); @@ -1594,14 +1593,14 @@ case 2: break; case 200: -#line 1299 "perly.y" +#line 1298 "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 201: -#line 1306 "perly.y" +#line 1305 "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),')'); @@ -1609,7 +1608,7 @@ case 2: break; case 202: -#line 1311 "perly.y" +#line 1310 "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),')'); @@ -1617,104 +1616,104 @@ case 2: break; case 203: -#line 1316 "perly.y" +#line 1315 "perly.y" { (yyval.opval) = (ps[(1) - (1)].val.opval); ;} break; case 204: -#line 1318 "perly.y" +#line 1317 "perly.y" { (yyval.opval) = (ps[(1) - (1)].val.opval); ;} break; case 205: -#line 1320 "perly.y" +#line 1319 "perly.y" { (yyval.opval) = (ps[(1) - (1)].val.opval); ;} break; case 206: -#line 1325 "perly.y" +#line 1324 "perly.y" { (yyval.opval) = (OP*)NULL; ;} break; case 207: -#line 1327 "perly.y" +#line 1326 "perly.y" { (yyval.opval) = (ps[(1) - (1)].val.opval); ;} break; case 208: -#line 1331 "perly.y" +#line 1330 "perly.y" { (yyval.opval) = (OP*)NULL; ;} break; case 209: -#line 1333 "perly.y" +#line 1332 "perly.y" { (yyval.opval) = (ps[(1) - (1)].val.opval); ;} break; case 210: -#line 1339 "perly.y" +#line 1338 "perly.y" { PL_parser->in_my = 0; (yyval.opval) = my((ps[(1) - (1)].val.opval)); ;} break; case 211: -#line 1343 "perly.y" +#line 1342 "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 212: -#line 1349 "perly.y" +#line 1348 "perly.y" { (yyval.opval) = newSVREF((ps[(2) - (2)].val.opval)); TOKEN_GETMAD((ps[(1) - (2)].val.i_tkval),(yyval.opval),'$'); ;} break; case 213: -#line 1355 "perly.y" +#line 1354 "perly.y" { (yyval.opval) = newAVREF((ps[(2) - (2)].val.opval)); TOKEN_GETMAD((ps[(1) - (2)].val.i_tkval),(yyval.opval),'@'); ;} break; case 214: -#line 1361 "perly.y" +#line 1360 "perly.y" { (yyval.opval) = newHVREF((ps[(2) - (2)].val.opval)); TOKEN_GETMAD((ps[(1) - (2)].val.i_tkval),(yyval.opval),'%'); ;} break; case 215: -#line 1367 "perly.y" +#line 1366 "perly.y" { (yyval.opval) = newAVREF((ps[(2) - (2)].val.opval)); TOKEN_GETMAD((ps[(1) - (2)].val.i_tkval),(yyval.opval),'l'); ;} break; case 216: -#line 1373 "perly.y" +#line 1372 "perly.y" { (yyval.opval) = newGVREF(0,(ps[(2) - (2)].val.opval)); TOKEN_GETMAD((ps[(1) - (2)].val.i_tkval),(yyval.opval),'*'); ;} break; case 217: -#line 1380 "perly.y" +#line 1379 "perly.y" { (yyval.opval) = scalar((ps[(1) - (1)].val.opval)); ;} break; case 218: -#line 1382 "perly.y" +#line 1381 "perly.y" { (yyval.opval) = scalar((ps[(1) - (1)].val.opval)); ;} break; case 219: -#line 1384 "perly.y" +#line 1383 "perly.y" { (yyval.opval) = op_scope((ps[(1) - (1)].val.opval)); ;} break; case 220: -#line 1387 "perly.y" +#line 1386 "perly.y" { (yyval.opval) = (ps[(1) - (1)].val.opval); ;} break; @@ -1725,6 +1724,6 @@ case 2: /* Generated from: - * c0743374d088d66f137508719cfbfb829d2ec6a195899c82274cc128b274022c perly.y + * 50649beb21bb272a5dafa43d5fbe244206c6a99e0e67b39b3123a22a35702873 perly.y * 38f866dcd8341ad3c0810347587113eb2c6ac7d4f33bdab75b020efce92865be regen_perly.pl * ex: set ro: */ diff --git a/perly.h b/perly.h index edc9dc7..1097227 100644 --- a/perly.h +++ b/perly.h @@ -242,6 +242,6 @@ typedef union YYSTYPE /* Generated from: - * c0743374d088d66f137508719cfbfb829d2ec6a195899c82274cc128b274022c perly.y + * 50649beb21bb272a5dafa43d5fbe244206c6a99e0e67b39b3123a22a35702873 perly.y * 38f866dcd8341ad3c0810347587113eb2c6ac7d4f33bdab75b020efce92865be regen_perly.pl * ex: set ro: */ diff --git a/perly.tab b/perly.tab index 2aad553..c5a8e66 100644 --- a/perly.tab +++ b/perly.tab @@ -180,27 +180,27 @@ static const yytype_uint16 yyrline[] = { 0, 140, 140, 139, 149, 148, 158, 157, 170, 169, 182, 181, 194, 193, 205, 215, 225, 228, 238, 243, - 244, 253, 261, 265, 272, 281, 283, 288, 306, 327, - 339, 355, 354, 371, 380, 389, 400, 402, 404, 414, - 424, 445, 454, 463, 472, 479, 478, 495, 501, 511, - 513, 515, 519, 523, 527, 531, 536, 542, 543, 549, - 563, 564, 573, 579, 580, 585, 588, 592, 597, 601, - 605, 609, 610, 614, 620, 625, 630, 640, 641, 646, - 647, 651, 661, 665, 675, 676, 686, 690, 694, 698, - 702, 712, 721, 725, 730, 737, 746, 752, 758, 766, - 770, 777, 776, 787, 788, 792, 801, 806, 814, 821, - 828, 838, 847, 854, 863, 870, 876, 883, 888, 898, - 902, 906, 912, 916, 920, 924, 928, 932, 936, 948, - 952, 956, 960, 970, 974, 981, 985, 989, 994, 999, - 1004, 1013, 1018, 1023, 1029, 1035, 1046, 1050, 1054, 1066, - 1079, 1087, 1099, 1100, 1101, 1102, 1103, 1108, 1112, 1114, - 1118, 1123, 1125, 1130, 1132, 1134, 1136, 1138, 1140, 1142, - 1151, 1162, 1164, 1166, 1171, 1184, 1189, 1194, 1198, 1202, - 1206, 1210, 1214, 1218, 1222, 1224, 1227, 1231, 1237, 1239, - 1244, 1247, 1256, 1263, 1262, 1278, 1279, 1280, 1286, 1290, - 1298, 1305, 1310, 1315, 1317, 1319, 1324, 1326, 1331, 1332, - 1338, 1342, 1348, 1354, 1360, 1366, 1372, 1379, 1381, 1383, - 1386 + 244, 253, 261, 265, 272, 281, 283, 288, 305, 326, + 338, 354, 353, 370, 379, 388, 399, 401, 403, 413, + 423, 444, 453, 462, 471, 478, 477, 494, 500, 510, + 512, 514, 518, 522, 526, 530, 535, 541, 542, 548, + 562, 563, 572, 578, 579, 584, 587, 591, 596, 600, + 604, 608, 609, 613, 619, 624, 629, 639, 640, 645, + 646, 650, 660, 664, 674, 675, 685, 689, 693, 697, + 701, 711, 720, 724, 729, 736, 745, 751, 757, 765, + 769, 776, 775, 786, 787, 791, 800, 805, 813, 820, + 827, 837, 846, 853, 862, 869, 875, 882, 887, 897, + 901, 905, 911, 915, 919, 923, 927, 931, 935, 947, + 951, 955, 959, 969, 973, 980, 984, 988, 993, 998, + 1003, 1012, 1017, 1022, 1028, 1034, 1045, 1049, 1053, 1065, + 1078, 1086, 1098, 1099, 1100, 1101, 1102, 1107, 1111, 1113, + 1117, 1122, 1124, 1129, 1131, 1133, 1135, 1137, 1139, 1141, + 1150, 1161, 1163, 1165, 1170, 1183, 1188, 1193, 1197, 1201, + 1205, 1209, 1213, 1217, 1221, 1223, 1226, 1230, 1236, 1238, + 1243, 1246, 1255, 1262, 1261, 1277, 1278, 1279, 1285, 1289, + 1297, 1304, 1309, 1314, 1316, 1318, 1323, 1325, 1330, 1331, + 1337, 1341, 1347, 1353, 1359, 1365, 1371, 1378, 1380, 1382, + 1385 }; #endif @@ -1113,6 +1113,6 @@ static const toketypes yy_type_tab[] = }; /* Generated from: - * c0743374d088d66f137508719cfbfb829d2ec6a195899c82274cc128b274022c perly.y + * 50649beb21bb272a5dafa43d5fbe244206c6a99e0e67b39b3123a22a35702873 perly.y * 38f866dcd8341ad3c0810347587113eb2c6ac7d4f33bdab75b020efce92865be regen_perly.pl * ex: set ro: */ diff --git a/perly.y b/perly.y index b940bc6..b9bc0eb 100644 --- a/perly.y +++ b/perly.y @@ -288,7 +288,6 @@ barestmt: PLUGSTMT | FORMAT startformsub formname formblock { CV *fmtcv = PL_compcv; - SvREFCNT_inc_simple_void(PL_compcv); #ifdef MAD $$ = newFORM($2, $3, $4); prepend_madprops($1->tk_mad, $$, 'F'); diff --git a/t/op/write.t b/t/op/write.t index 60ae9b3..090fc4f 100644 --- a/t/op/write.t +++ b/t/op/write.t @@ -61,7 +61,7 @@ for my $tref ( @NumTests ){ my $bas_tests = 21; # number of tests in section 3 -my $bug_tests = 8 + 3 * 3 * 5 * 2 * 3 + 2 + 66 + 4 + 2 + 3 + 96 + 5; +my $bug_tests = 8 + 3 * 3 * 5 * 2 * 3 + 2 + 66 + 4 + 2 + 3 + 96 + 6; # number of tests in section 4 my $hmb_tests = 35; @@ -1047,6 +1047,17 @@ write NEST; close NEST or die "Could not close: $!"; is cat('Op_write.tmp'), "birds\nnest\n", 'nested formats'; +# A compilation error should not create a format +eval q| +format ERROR = +@ +@_ =~ s/// +. +|; +eval { write ERROR }; +like $@, qr'Undefined format', + 'formats with compilation errors are not created'; + ############################# ## Section 4 -- 2.7.4