diff options
Diffstat (limited to 'perly.act')
-rw-r--r-- | perly.act | 1027 |
1 files changed, 650 insertions, 377 deletions
@@ -5,7 +5,7 @@ */ case 2: -#line 115 "perly.y" /* yacc.c:1646 */ +#line 118 "perly.y" /* yacc.c:1646 */ { parser->expect = XSTATE; } @@ -13,7 +13,7 @@ case 2: break; case 3: -#line 119 "perly.y" /* yacc.c:1646 */ +#line 122 "perly.y" /* yacc.c:1646 */ { newPROG(block_end((ps[-1].val.ival),(ps[0].val.opval))); PL_compiling.cop_seq = 0; @@ -23,7 +23,7 @@ case 2: break; case 4: -#line 125 "perly.y" /* yacc.c:1646 */ +#line 128 "perly.y" /* yacc.c:1646 */ { parser->expect = XTERM; } @@ -31,7 +31,7 @@ case 2: break; case 5: -#line 129 "perly.y" /* yacc.c:1646 */ +#line 132 "perly.y" /* yacc.c:1646 */ { PL_eval_root = (ps[0].val.opval); (yyval.ival) = 0; @@ -40,7 +40,7 @@ case 2: break; case 6: -#line 134 "perly.y" /* yacc.c:1646 */ +#line 137 "perly.y" /* yacc.c:1646 */ { parser->expect = XBLOCK; } @@ -48,7 +48,7 @@ case 2: break; case 7: -#line 138 "perly.y" /* yacc.c:1646 */ +#line 141 "perly.y" /* yacc.c:1646 */ { PL_pad_reset_pending = TRUE; PL_eval_root = (ps[0].val.opval); @@ -60,7 +60,7 @@ case 2: break; case 8: -#line 146 "perly.y" /* yacc.c:1646 */ +#line 149 "perly.y" /* yacc.c:1646 */ { parser->expect = XSTATE; } @@ -68,7 +68,7 @@ case 2: break; case 9: -#line 150 "perly.y" /* yacc.c:1646 */ +#line 153 "perly.y" /* yacc.c:1646 */ { PL_pad_reset_pending = TRUE; PL_eval_root = (ps[0].val.opval); @@ -80,7 +80,7 @@ case 2: break; case 10: -#line 158 "perly.y" /* yacc.c:1646 */ +#line 161 "perly.y" /* yacc.c:1646 */ { parser->expect = XSTATE; } @@ -88,7 +88,7 @@ case 2: break; case 11: -#line 162 "perly.y" /* yacc.c:1646 */ +#line 165 "perly.y" /* yacc.c:1646 */ { PL_pad_reset_pending = TRUE; PL_eval_root = (ps[0].val.opval); @@ -100,7 +100,7 @@ case 2: break; case 12: -#line 170 "perly.y" /* yacc.c:1646 */ +#line 173 "perly.y" /* yacc.c:1646 */ { parser->expect = XSTATE; } @@ -108,7 +108,7 @@ case 2: break; case 13: -#line 174 "perly.y" /* yacc.c:1646 */ +#line 177 "perly.y" /* yacc.c:1646 */ { PL_eval_root = (ps[0].val.opval); (yyval.ival) = 0; @@ -117,7 +117,7 @@ case 2: break; case 14: -#line 182 "perly.y" /* yacc.c:1646 */ +#line 185 "perly.y" /* yacc.c:1646 */ { if (parser->copline > (line_t)(ps[-3].val.ival)) parser->copline = (line_t)(ps[-3].val.ival); (yyval.opval) = block_end((ps[-2].val.ival), (ps[-1].val.opval)); @@ -126,7 +126,7 @@ case 2: break; case 15: -#line 190 "perly.y" /* yacc.c:1646 */ +#line 193 "perly.y" /* yacc.c:1646 */ { if (parser->copline > (line_t)(ps[-6].val.ival)) parser->copline = (line_t)(ps[-6].val.ival); (yyval.opval) = block_end((ps[-5].val.ival), (ps[-2].val.opval)); @@ -135,14 +135,14 @@ case 2: break; case 16: -#line 197 "perly.y" /* yacc.c:1646 */ +#line 200 "perly.y" /* yacc.c:1646 */ { (yyval.ival) = block_start(TRUE); parser->parsed_sub = 0; } break; case 17: -#line 202 "perly.y" /* yacc.c:1646 */ +#line 205 "perly.y" /* yacc.c:1646 */ { if (parser->copline > (line_t)(ps[-3].val.ival)) parser->copline = (line_t)(ps[-3].val.ival); (yyval.opval) = block_end((ps[-2].val.ival), (ps[-1].val.opval)); @@ -151,20 +151,20 @@ case 2: break; case 18: -#line 209 "perly.y" /* yacc.c:1646 */ +#line 212 "perly.y" /* yacc.c:1646 */ { (yyval.ival) = block_start(FALSE); parser->parsed_sub = 0; } break; case 19: -#line 215 "perly.y" /* yacc.c:1646 */ +#line 218 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = (OP*)NULL; } break; case 20: -#line 217 "perly.y" /* yacc.c:1646 */ +#line 220 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = op_append_list(OP_LINESEQ, (ps[-1].val.opval), (ps[0].val.opval)); PL_pad_reset_pending = TRUE; if ((ps[-1].val.opval) && (ps[0].val.opval)) @@ -174,13 +174,13 @@ case 2: break; case 21: -#line 226 "perly.y" /* yacc.c:1646 */ +#line 229 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = (OP*)NULL; } break; case 22: -#line 228 "perly.y" /* yacc.c:1646 */ +#line 231 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = op_append_list(OP_LINESEQ, (ps[-1].val.opval), (ps[0].val.opval)); PL_pad_reset_pending = TRUE; if ((ps[-1].val.opval) && (ps[0].val.opval)) @@ -190,7 +190,7 @@ case 2: break; case 23: -#line 237 "perly.y" /* yacc.c:1646 */ +#line 240 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = (ps[0].val.opval) ? newSTATEOP(0, NULL, (ps[0].val.opval)) : NULL; } @@ -198,13 +198,13 @@ case 2: break; case 24: -#line 241 "perly.y" /* yacc.c:1646 */ +#line 244 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = (ps[0].val.opval); } break; case 25: -#line 245 "perly.y" /* yacc.c:1646 */ +#line 248 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = newSTATEOP(SVf_UTF8 * (ps[-1].val.pval)[strlen((ps[-1].val.pval))+1], (ps[-1].val.pval), (ps[0].val.opval)); } @@ -212,7 +212,7 @@ case 2: break; case 26: -#line 249 "perly.y" /* yacc.c:1646 */ +#line 252 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = newSTATEOP(SVf_UTF8 * (ps[-1].val.pval)[strlen((ps[-1].val.pval))+1], (ps[-1].val.pval), (ps[0].val.opval)); } @@ -220,13 +220,13 @@ case 2: break; case 27: -#line 256 "perly.y" /* yacc.c:1646 */ +#line 259 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = (ps[0].val.opval); } break; case 28: -#line 258 "perly.y" /* yacc.c:1646 */ +#line 261 "perly.y" /* yacc.c:1646 */ { CV *fmtcv = PL_compcv; newFORM((ps[-2].val.ival), (ps[-1].val.opval), (ps[0].val.opval)); @@ -240,7 +240,7 @@ case 2: break; case 29: -#line 268 "perly.y" /* yacc.c:1646 */ +#line 271 "perly.y" /* yacc.c:1646 */ { if ((ps[-1].val.opval)->op_type == OP_CONST) { const char *const name = @@ -266,7 +266,7 @@ case 2: break; case 30: -#line 290 "perly.y" /* yacc.c:1646 */ +#line 293 "perly.y" /* yacc.c:1646 */ { SvREFCNT_inc_simple_void(PL_compcv); (ps[-5].val.opval)->op_type == OP_CONST @@ -281,7 +281,7 @@ case 2: break; case 31: -#line 301 "perly.y" /* yacc.c:1646 */ +#line 304 "perly.y" /* yacc.c:1646 */ { if ((ps[-1].val.opval)->op_type == OP_CONST) { const char *const name = @@ -307,7 +307,7 @@ case 2: break; case 32: -#line 323 "perly.y" /* yacc.c:1646 */ +#line 326 "perly.y" /* yacc.c:1646 */ { OP *body; if (parser->copline > (line_t)(ps[-2].val.ival)) @@ -328,7 +328,7 @@ case 2: break; case 33: -#line 340 "perly.y" /* yacc.c:1646 */ +#line 343 "perly.y" /* yacc.c:1646 */ { package((ps[-1].val.opval)); if ((ps[-2].val.opval)) @@ -339,13 +339,13 @@ case 2: break; case 34: -#line 347 "perly.y" /* yacc.c:1646 */ +#line 350 "perly.y" /* yacc.c:1646 */ { CvSPECIAL_on(PL_compcv); /* It's a BEGIN {} */ } break; case 35: -#line 349 "perly.y" /* yacc.c:1646 */ +#line 352 "perly.y" /* yacc.c:1646 */ { SvREFCNT_inc_simple_void(PL_compcv); utilize((ps[-6].val.ival), (ps[-5].val.ival), (ps[-3].val.opval), (ps[-2].val.opval), (ps[-1].val.opval)); @@ -356,7 +356,7 @@ case 2: break; case 36: -#line 356 "perly.y" /* yacc.c:1646 */ +#line 359 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = block_end((ps[-4].val.ival), newCONDOP(0, (ps[-3].val.opval), op_scope((ps[-1].val.opval)), (ps[0].val.opval))); @@ -366,7 +366,7 @@ case 2: break; case 37: -#line 362 "perly.y" /* yacc.c:1646 */ +#line 365 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = block_end((ps[-4].val.ival), newCONDOP(0, (ps[-3].val.opval), (ps[0].val.opval), op_scope((ps[-1].val.opval)))); @@ -376,7 +376,7 @@ case 2: break; case 38: -#line 368 "perly.y" /* yacc.c:1646 */ +#line 371 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = block_end((ps[-3].val.ival), newGIVENOP((ps[-2].val.opval), op_scope((ps[0].val.opval)), 0)); parser->copline = (line_t)(ps[-5].val.ival); @@ -385,19 +385,19 @@ case 2: break; case 39: -#line 373 "perly.y" /* yacc.c:1646 */ +#line 376 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = block_end((ps[-3].val.ival), newWHENOP((ps[-2].val.opval), op_scope((ps[0].val.opval)))); } break; case 40: -#line 375 "perly.y" /* yacc.c:1646 */ +#line 378 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = newWHENOP(0, op_scope((ps[0].val.opval))); } break; case 41: -#line 377 "perly.y" /* yacc.c:1646 */ +#line 380 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = block_end((ps[-5].val.ival), newWHILEOP(0, 1, (LOOP*)(OP*)NULL, @@ -408,7 +408,7 @@ case 2: break; case 42: -#line 384 "perly.y" /* yacc.c:1646 */ +#line 387 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = block_end((ps[-5].val.ival), newWHILEOP(0, 1, (LOOP*)(OP*)NULL, @@ -419,19 +419,19 @@ case 2: break; case 43: -#line 391 "perly.y" /* yacc.c:1646 */ +#line 394 "perly.y" /* yacc.c:1646 */ { parser->expect = XTERM; } break; case 44: -#line 393 "perly.y" /* yacc.c:1646 */ +#line 396 "perly.y" /* yacc.c:1646 */ { parser->expect = XTERM; } break; case 45: -#line 396 "perly.y" /* yacc.c:1646 */ +#line 399 "perly.y" /* yacc.c:1646 */ { OP *initop = (ps[-9].val.opval); OP *forop = newWHILEOP(0, 1, (LOOP*)(OP*)NULL, @@ -450,7 +450,7 @@ case 2: break; case 46: -#line 411 "perly.y" /* yacc.c:1646 */ +#line 414 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = block_end((ps[-6].val.ival), newFOROP(0, (ps[-5].val.opval), (ps[-3].val.opval), (ps[-1].val.opval), (ps[0].val.opval))); parser->copline = (line_t)(ps[-8].val.ival); @@ -459,7 +459,7 @@ case 2: break; case 47: -#line 416 "perly.y" /* yacc.c:1646 */ +#line 419 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = block_end((ps[-4].val.ival), newFOROP(0, op_lvalue((ps[-6].val.opval), OP_ENTERLOOP), (ps[-3].val.opval), (ps[-1].val.opval), (ps[0].val.opval))); @@ -469,13 +469,13 @@ case 2: break; case 48: -#line 422 "perly.y" /* yacc.c:1646 */ +#line 425 "perly.y" /* yacc.c:1646 */ { parser->in_my = 0; (yyval.opval) = my((ps[0].val.opval)); } break; case 49: -#line 424 "perly.y" /* yacc.c:1646 */ +#line 427 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = block_end( (ps[-7].val.ival), @@ -492,7 +492,7 @@ case 2: break; case 50: -#line 437 "perly.y" /* yacc.c:1646 */ +#line 440 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = block_end((ps[-4].val.ival), newFOROP( 0, op_lvalue(newUNOP(OP_REFGEN, 0, @@ -504,7 +504,7 @@ case 2: break; case 51: -#line 445 "perly.y" /* yacc.c:1646 */ +#line 448 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = block_end((ps[-4].val.ival), newFOROP(0, (OP*)NULL, (ps[-3].val.opval), (ps[-1].val.opval), (ps[0].val.opval))); @@ -514,7 +514,7 @@ case 2: break; case 52: -#line 451 "perly.y" /* yacc.c:1646 */ +#line 454 "perly.y" /* yacc.c:1646 */ { /* a block is a loop that happens once */ (yyval.opval) = newWHILEOP(0, 1, (LOOP*)(OP*)NULL, @@ -524,7 +524,7 @@ case 2: break; case 53: -#line 457 "perly.y" /* yacc.c:1646 */ +#line 460 "perly.y" /* yacc.c:1646 */ { package((ps[-2].val.opval)); if ((ps[-3].val.opval)) { @@ -535,7 +535,7 @@ case 2: break; case 54: -#line 464 "perly.y" /* yacc.c:1646 */ +#line 467 "perly.y" /* yacc.c:1646 */ { /* a block is a loop that happens once */ (yyval.opval) = newWHILEOP(0, 1, (LOOP*)(OP*)NULL, @@ -547,7 +547,7 @@ case 2: break; case 55: -#line 472 "perly.y" /* yacc.c:1646 */ +#line 475 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = (ps[-1].val.opval); } @@ -555,7 +555,7 @@ case 2: break; case 56: -#line 476 "perly.y" /* yacc.c:1646 */ +#line 479 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = (OP*)NULL; parser->copline = NOLINE; @@ -564,7 +564,7 @@ case 2: break; case 57: -#line 484 "perly.y" /* yacc.c:1646 */ +#line 487 "perly.y" /* yacc.c:1646 */ { OP *list; if ((ps[0].val.opval)) { OP *term = (ps[0].val.opval); @@ -583,74 +583,74 @@ case 2: break; case 58: -#line 501 "perly.y" /* yacc.c:1646 */ +#line 504 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = NULL; } break; case 59: -#line 503 "perly.y" /* yacc.c:1646 */ +#line 506 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = op_unscope((ps[-1].val.opval)); } break; case 60: -#line 508 "perly.y" /* yacc.c:1646 */ +#line 511 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = (OP*)NULL; } break; case 61: -#line 510 "perly.y" /* yacc.c:1646 */ +#line 513 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = (ps[0].val.opval); } break; case 62: -#line 512 "perly.y" /* yacc.c:1646 */ +#line 515 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = newLOGOP(OP_AND, 0, (ps[0].val.opval), (ps[-2].val.opval)); } break; case 63: -#line 514 "perly.y" /* yacc.c:1646 */ +#line 517 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = newLOGOP(OP_OR, 0, (ps[0].val.opval), (ps[-2].val.opval)); } break; case 64: -#line 516 "perly.y" /* yacc.c:1646 */ +#line 519 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = newLOOPOP(OPf_PARENS, 1, scalar((ps[0].val.opval)), (ps[-2].val.opval)); } break; case 65: -#line 518 "perly.y" /* yacc.c:1646 */ +#line 521 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = newLOOPOP(OPf_PARENS, 1, (ps[0].val.opval), (ps[-2].val.opval)); } break; case 66: -#line 520 "perly.y" /* yacc.c:1646 */ +#line 523 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = newFOROP(0, (OP*)NULL, (ps[0].val.opval), (ps[-2].val.opval), (OP*)NULL); parser->copline = (line_t)(ps[-1].val.ival); } break; case 67: -#line 523 "perly.y" /* yacc.c:1646 */ +#line 526 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = newWHENOP((ps[0].val.opval), op_scope((ps[-2].val.opval))); } break; case 68: -#line 528 "perly.y" /* yacc.c:1646 */ +#line 531 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = (OP*)NULL; } break; case 69: -#line 530 "perly.y" /* yacc.c:1646 */ +#line 533 "perly.y" /* yacc.c:1646 */ { ((ps[0].val.opval))->op_flags |= OPf_PARENS; (yyval.opval) = op_scope((ps[0].val.opval)); @@ -659,7 +659,7 @@ case 2: break; case 70: -#line 535 "perly.y" /* yacc.c:1646 */ +#line 538 "perly.y" /* yacc.c:1646 */ { parser->copline = (line_t)(ps[-5].val.ival); (yyval.opval) = newCONDOP(0, newSTATEOP(OPf_SPECIAL,NULL,(ps[-3].val.opval)), @@ -670,19 +670,19 @@ case 2: break; case 71: -#line 545 "perly.y" /* yacc.c:1646 */ +#line 548 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = (OP*)NULL; } break; case 72: -#line 547 "perly.y" /* yacc.c:1646 */ +#line 550 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = op_scope((ps[0].val.opval)); } break; case 73: -#line 552 "perly.y" /* yacc.c:1646 */ +#line 555 "perly.y" /* yacc.c:1646 */ { (yyval.ival) = (PL_min_intro_pending && PL_max_intro_pending >= PL_min_intro_pending); intro_my(); } @@ -690,13 +690,13 @@ case 2: break; case 74: -#line 558 "perly.y" /* yacc.c:1646 */ +#line 561 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = (OP*)NULL; } break; case 76: -#line 564 "perly.y" /* yacc.c:1646 */ +#line 567 "perly.y" /* yacc.c:1646 */ { YYSTYPE tmplval; (void)scan_num("1", &tmplval); (yyval.opval) = tmplval.opval; } @@ -704,148 +704,421 @@ case 2: break; case 78: -#line 572 "perly.y" /* yacc.c:1646 */ +#line 575 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = invert(scalar((ps[0].val.opval))); } break; case 79: -#line 577 "perly.y" /* yacc.c:1646 */ +#line 580 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = (ps[0].val.opval); intro_my(); } break; case 80: -#line 581 "perly.y" /* yacc.c:1646 */ +#line 584 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = (ps[0].val.opval); intro_my(); } break; case 81: -#line 584 "perly.y" /* yacc.c:1646 */ +#line 587 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = (ps[0].val.opval); } break; case 82: -#line 585 "perly.y" /* yacc.c:1646 */ +#line 588 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = (OP*)NULL; } break; case 83: -#line 589 "perly.y" /* yacc.c:1646 */ +#line 592 "perly.y" /* yacc.c:1646 */ { (yyval.ival) = start_subparse(FALSE, 0); SAVEFREESV(PL_compcv); } break; case 84: -#line 595 "perly.y" /* yacc.c:1646 */ +#line 598 "perly.y" /* yacc.c:1646 */ { (yyval.ival) = start_subparse(FALSE, CVf_ANON); SAVEFREESV(PL_compcv); } break; case 85: -#line 600 "perly.y" /* yacc.c:1646 */ +#line 603 "perly.y" /* yacc.c:1646 */ { (yyval.ival) = start_subparse(TRUE, 0); SAVEFREESV(PL_compcv); } break; case 88: -#line 611 "perly.y" /* yacc.c:1646 */ +#line 614 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = (OP*)NULL; } break; case 90: -#line 617 "perly.y" /* yacc.c:1646 */ +#line 620 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = (OP*)NULL; } break; case 91: -#line 619 "perly.y" /* yacc.c:1646 */ +#line 622 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = (ps[0].val.opval); } break; case 92: -#line 621 "perly.y" /* yacc.c:1646 */ +#line 624 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = (OP*)NULL; } break; case 93: -#line 626 "perly.y" /* yacc.c:1646 */ +#line 629 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = (ps[0].val.opval); } break; case 94: -#line 628 "perly.y" /* yacc.c:1646 */ +#line 631 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = (OP*)NULL; } break; case 95: -#line 633 "perly.y" /* yacc.c:1646 */ +#line 642 "perly.y" /* yacc.c:1646 */ + { (yyval.opval) = (OP*)NULL; } + + break; + + case 96: +#line 644 "perly.y" /* yacc.c:1646 */ + { + (yyval.opval) = (ps[0].val.opval); + PL_parser->in_my = 0; + } + + break; + + case 97: +#line 652 "perly.y" /* yacc.c:1646 */ + { (yyval.ival) = '@'; } + + break; + + case 98: +#line 654 "perly.y" /* yacc.c:1646 */ + { (yyval.ival) = '%'; } + + break; + + case 99: +#line 658 "perly.y" /* yacc.c:1646 */ + { + I32 sigil = (ps[-2].val.ival); + OP *var = (ps[-1].val.opval); + OP *defexpr = (ps[0].val.opval); + int type = (sigil == '@' ? OP_PADAV : OP_PADHV); + + if (PL_parser->sig_slurpy) + yyerror("Multiple slurpy parameters not allowed"); + PL_parser->sig_slurpy = sigil; + + if (defexpr) + yyerror("a slurpy parameter may not have " + "a default value"); + + if (var) { + OP *slice; + + var->op_type = type; + var->op_ppaddr = PL_ppaddr[type]; + var->op_flags = (OPf_WANT_LIST | OPf_MOD); + var->op_private = OPpLVAL_INTRO; + + slice = PL_parser->sig_elems + ? op_prepend_elem(OP_ASLICE, + newOP(OP_PUSHMARK, 0), + newLISTOP(OP_ASLICE, 0, + list(newRANGE(0, + newSVOP(OP_CONST, 0, + newSViv(PL_parser->sig_elems)), + newUNOP(OP_AV2ARYLEN, 0, + ref(newUNOP(OP_RV2AV, 0, + newGVOP(OP_GV, 0, PL_defgv)), + OP_AV2ARYLEN)))), + ref(newUNOP(OP_RV2AV, 0, + newGVOP(OP_GV, 0, PL_defgv)), + OP_ASLICE))) + : newUNOP(OP_RV2AV, 0, newGVOP(OP_GV, 0, PL_defgv)); + (yyval.opval) = newSTATEOP(0, NULL, + newASSIGNOP(OPf_STACKED, var, 0, slice)); + } + else + (yyval.opval) = (OP*)NULL; + } + + break; + + case 100: +#line 705 "perly.y" /* yacc.c:1646 */ + { (yyval.opval) = (OP*)NULL; } + + break; + + case 101: +#line 707 "perly.y" /* yacc.c:1646 */ + { (yyval.opval) = newOP(OP_NULL, 0); } + + break; + + case 102: +#line 709 "perly.y" /* yacc.c:1646 */ + { (yyval.opval) = (ps[0].val.opval); } + + break; + + case 103: +#line 715 "perly.y" /* yacc.c:1646 */ { - /* We shouldn't get here otherwise */ - assert(FEATURE_SIGNATURES_IS_ENABLED); + OP *var = (ps[-1].val.opval); + OP *defexpr = (ps[0].val.opval); + OP *argn = NULL; + OP *expr = NULL; + + if (PL_parser->sig_slurpy) + yyerror("Slurpy parameter not last"); + + PL_parser->sig_elems++; + + if (var) { + var->op_type = OP_PADSV; + var->op_ppaddr = PL_ppaddr[OP_PADSV]; + var->op_flags = (OPf_WANT_SCALAR | OPf_MOD); + var->op_private = OPpLVAL_INTRO; + } + + /* $_[N] */ + argn = newBINOP(OP_AELEM, 0, + ref(newUNOP(OP_RV2AV, 0, + newGVOP(OP_GV, 0, PL_defgv)), + OP_RV2AV), + newSVOP(OP_CONST, 0, + newSViv(PL_parser->sig_elems - 1))); + + if (defexpr) { + PL_parser->sig_optelems++; + /* is it '$var=undef', '$=' ? */ + if ( ( defexpr->op_type == OP_NULL + || defexpr->op_type == OP_UNDEF) + && !(defexpr->op_flags & OPf_KIDS)) + { + if (var) { + /* '$=' is legal, '$var=' isn't */ + if (defexpr->op_type == OP_NULL) + yyerror("Optional parameter " + "lacks default expression"); + else + expr = argn; + } + op_free(defexpr); + } + else { + /* @_ >= N */ + OP *ge_op = + newBINOP(OP_GE, 0, + scalar(newUNOP(OP_RV2AV, 0, + newGVOP(OP_GV, 0, PL_defgv))), + newSVOP(OP_CONST, 0, + newSViv(PL_parser->sig_elems))); + + expr = var + ? newCONDOP(0, ge_op, argn, defexpr) + : newLOGOP(OP_OR, 0, ge_op, defexpr); + } + } + else { + if (PL_parser->sig_optelems) + yyerror("Mandatory parameter " + "follows optional parameter"); + expr = argn; + } + + if (var) + expr = newASSIGNOP(OPf_STACKED, var, 0, expr); + if (expr) + (yyval.opval) = op_prepend_elem(OP_LINESEQ, + newSTATEOP(0, NULL, NULL), + expr); + else + (yyval.opval) = (OP*)NULL; + } - Perl_ck_warner_d(aTHX_ - packWARN(WARN_EXPERIMENTAL__SIGNATURES), - "The signatures feature is experimental"); - (yyval.opval) = parse_subsignature(); + break; + + case 104: +#line 793 "perly.y" /* yacc.c:1646 */ + { parser->expect = XSIGVAR; (yyval.opval) = (ps[0].val.opval); } + + break; + + case 105: +#line 795 "perly.y" /* yacc.c:1646 */ + { parser->expect = XSIGVAR; (yyval.opval) = (ps[0].val.opval); } + + break; + + case 106: +#line 801 "perly.y" /* yacc.c:1646 */ + { (yyval.opval) = (ps[-1].val.opval); } + + break; + + case 107: +#line 803 "perly.y" /* yacc.c:1646 */ + { + (yyval.opval) = op_append_list(OP_LINESEQ, (ps[-2].val.opval), (ps[0].val.opval)); } break; - case 96: -#line 643 "perly.y" /* yacc.c:1646 */ + case 108: +#line 807 "perly.y" /* yacc.c:1646 */ + { (yyval.opval) = (ps[0].val.opval); } + + break; + + case 109: +#line 812 "perly.y" /* yacc.c:1646 */ + { (yyval.opval) = (OP*)NULL; } + + break; + + case 110: +#line 814 "perly.y" /* yacc.c:1646 */ + { (yyval.opval) = (ps[0].val.opval); } + + break; + + case 111: +#line 818 "perly.y" /* yacc.c:1646 */ { - (yyval.opval) = op_append_list(OP_LINESEQ, (ps[-1].val.opval), - newSTATEOP(0, NULL, sawparens(newNULLLIST()))); - parser->expect = XATTRBLOCK; + ENTER; + SAVEINT(PL_parser->sig_elems); + SAVEINT(PL_parser->sig_optelems); + SAVEI8(PL_parser->sig_slurpy); + PL_parser->sig_elems = 0; + PL_parser->sig_optelems = 0; + PL_parser->sig_slurpy = 0; + parser->expect = XSIGVAR; + } + + break; + + case 112: +#line 830 "perly.y" /* yacc.c:1646 */ + { + OP *sigops = (ps[-1].val.opval); + int min_arity = + PL_parser->sig_elems - PL_parser->sig_optelems; + + assert(FEATURE_SIGNATURES_IS_ENABLED); + + /* We shouldn't get here otherwise */ + Perl_ck_warner_d(aTHX_ + packWARN(WARN_EXPERIMENTAL__SIGNATURES), + "The signatures feature is experimental"); + + /* handle odd/even for %foo */ + if (PL_parser->sig_slurpy == '%') { + OP *chkop = + newLOGOP( + (PL_parser->sig_elems & 1) + ? OP_OR : OP_AND, + 0, + newBINOP(OP_BIT_AND, 0, + scalar(newUNOP(OP_RV2AV, 0, + newGVOP(OP_GV, 0, PL_defgv))), + newSVOP(OP_CONST, 0, newSViv(1))), + op_convert_list(OP_DIE, 0, + op_convert_list(OP_SPRINTF, 0, + op_append_list(OP_LIST, + newSVOP(OP_CONST, 0, + newSVpvs("Odd name/value argument for subroutine at %s line %d.\n")), + newSLICEOP(0, + op_append_list(OP_LIST, + newSVOP(OP_CONST, 0, newSViv(1)), + newSVOP(OP_CONST, 0, newSViv(2))), + newOP(OP_CALLER, 0)))))); + if (PL_parser->sig_optelems) + chkop = newLOGOP(OP_AND, 0, + newBINOP(OP_GT, 0, + scalar(newUNOP(OP_RV2AV, 0, + newGVOP(OP_GV, 0, PL_defgv))), + newSVOP(OP_CONST, 0, + newSViv(PL_parser->sig_elems))), + chkop); + sigops = op_prepend_elem(OP_LINESEQ, + chkop, sigops); + + } + if (min_arity) + sigops = op_prepend_elem(OP_LINESEQ, + Perl_check_arity(aTHX_ min_arity, + FALSE), + sigops); + if (!PL_parser->sig_slurpy) + sigops = op_prepend_elem(OP_LINESEQ, + Perl_check_arity(aTHX_ + PL_parser->sig_elems, TRUE), + sigops); + + (yyval.opval) = op_append_elem(OP_LINESEQ, sigops, + newSTATEOP(0, NULL, NULL)); + + parser->expect = XATTRBLOCK; + LEAVE; } break; - case 98: -#line 652 "perly.y" /* yacc.c:1646 */ + case 114: +#line 898 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = (OP*)NULL; } break; - case 99: -#line 657 "perly.y" /* yacc.c:1646 */ + case 115: +#line 903 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = newLOGOP(OP_AND, 0, (ps[-2].val.opval), (ps[0].val.opval)); } break; - case 100: -#line 659 "perly.y" /* yacc.c:1646 */ + case 116: +#line 905 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = newLOGOP((ps[-1].val.ival), 0, (ps[-2].val.opval), (ps[0].val.opval)); } break; - case 101: -#line 661 "perly.y" /* yacc.c:1646 */ + case 117: +#line 907 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = newLOGOP(OP_DOR, 0, (ps[-2].val.opval), (ps[0].val.opval)); } break; - case 103: -#line 667 "perly.y" /* yacc.c:1646 */ + case 119: +#line 913 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = (ps[-1].val.opval); } break; - case 104: -#line 669 "perly.y" /* yacc.c:1646 */ + case 120: +#line 915 "perly.y" /* yacc.c:1646 */ { OP* term = (ps[0].val.opval); (yyval.opval) = op_append_elem(OP_LIST, (ps[-2].val.opval), term); @@ -853,24 +1126,24 @@ case 2: break; - case 106: -#line 678 "perly.y" /* yacc.c:1646 */ + case 122: +#line 924 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = op_convert_list((ps[-2].val.ival), OPf_STACKED, op_prepend_elem(OP_LIST, newGVREF((ps[-2].val.ival),(ps[-1].val.opval)), (ps[0].val.opval)) ); } break; - case 107: -#line 682 "perly.y" /* yacc.c:1646 */ + case 123: +#line 928 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = op_convert_list((ps[-4].val.ival), OPf_STACKED, op_prepend_elem(OP_LIST, newGVREF((ps[-4].val.ival),(ps[-2].val.opval)), (ps[-1].val.opval)) ); } break; - case 108: -#line 686 "perly.y" /* yacc.c:1646 */ + case 124: +#line 932 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = op_convert_list(OP_ENTERSUB, OPf_STACKED, op_append_elem(OP_LIST, op_prepend_elem(OP_LIST, scalar((ps[-5].val.opval)), (ps[-1].val.opval)), @@ -879,8 +1152,8 @@ case 2: break; - case 109: -#line 692 "perly.y" /* yacc.c:1646 */ + case 125: +#line 938 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = op_convert_list(OP_ENTERSUB, OPf_STACKED, op_append_elem(OP_LIST, scalar((ps[-2].val.opval)), newMETHOP(OP_METHOD, 0, (ps[0].val.opval)))); @@ -888,8 +1161,8 @@ case 2: break; - case 110: -#line 697 "perly.y" /* yacc.c:1646 */ + case 126: +#line 943 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = op_convert_list(OP_ENTERSUB, OPf_STACKED, op_append_elem(OP_LIST, op_prepend_elem(OP_LIST, (ps[-1].val.opval), (ps[0].val.opval)), @@ -898,8 +1171,8 @@ case 2: break; - case 111: -#line 703 "perly.y" /* yacc.c:1646 */ + case 127: +#line 949 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = op_convert_list(OP_ENTERSUB, OPf_STACKED, op_append_elem(OP_LIST, op_prepend_elem(OP_LIST, (ps[-3].val.opval), (ps[-1].val.opval)), @@ -908,27 +1181,27 @@ case 2: break; - case 112: -#line 709 "perly.y" /* yacc.c:1646 */ + case 128: +#line 955 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = op_convert_list((ps[-1].val.ival), 0, (ps[0].val.opval)); } break; - case 113: -#line 711 "perly.y" /* yacc.c:1646 */ + case 129: +#line 957 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = op_convert_list((ps[-3].val.ival), 0, (ps[-1].val.opval)); } break; - case 114: -#line 713 "perly.y" /* yacc.c:1646 */ + case 130: +#line 959 "perly.y" /* yacc.c:1646 */ { SvREFCNT_inc_simple_void(PL_compcv); (yyval.opval) = newANONATTRSUB((ps[-1].val.ival), 0, (OP*)NULL, (ps[0].val.opval)); } break; - case 115: -#line 716 "perly.y" /* yacc.c:1646 */ + case 131: +#line 962 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_STACKED, op_append_elem(OP_LIST, op_prepend_elem(OP_LIST, (ps[-1].val.opval), (ps[0].val.opval)), (ps[-4].val.opval))); @@ -936,21 +1209,21 @@ case 2: break; - case 118: -#line 731 "perly.y" /* yacc.c:1646 */ + case 134: +#line 977 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = newBINOP(OP_GELEM, 0, (ps[-4].val.opval), scalar((ps[-2].val.opval))); } break; - case 119: -#line 733 "perly.y" /* yacc.c:1646 */ + case 135: +#line 979 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = newBINOP(OP_AELEM, 0, oopsAV((ps[-3].val.opval)), scalar((ps[-1].val.opval))); } break; - case 120: -#line 736 "perly.y" /* yacc.c:1646 */ + case 136: +#line 982 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = newBINOP(OP_AELEM, 0, ref(newAVREF((ps[-4].val.opval)),OP_RV2AV), scalar((ps[-1].val.opval))); @@ -958,8 +1231,8 @@ case 2: break; - case 121: -#line 741 "perly.y" /* yacc.c:1646 */ + case 137: +#line 987 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = newBINOP(OP_AELEM, 0, ref(newAVREF((ps[-3].val.opval)),OP_RV2AV), scalar((ps[-1].val.opval))); @@ -967,91 +1240,91 @@ case 2: break; - case 122: -#line 746 "perly.y" /* yacc.c:1646 */ + case 138: +#line 992 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = newBINOP(OP_HELEM, 0, oopsHV((ps[-4].val.opval)), jmaybe((ps[-2].val.opval))); } break; - case 123: -#line 749 "perly.y" /* yacc.c:1646 */ + case 139: +#line 995 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = newBINOP(OP_HELEM, 0, ref(newHVREF((ps[-5].val.opval)),OP_RV2HV), jmaybe((ps[-2].val.opval))); } break; - case 124: -#line 753 "perly.y" /* yacc.c:1646 */ + case 140: +#line 999 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = newBINOP(OP_HELEM, 0, ref(newHVREF((ps[-4].val.opval)),OP_RV2HV), jmaybe((ps[-2].val.opval))); } break; - case 125: -#line 757 "perly.y" /* yacc.c:1646 */ + case 141: +#line 1003 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_STACKED, newCVREF(0, scalar((ps[-3].val.opval)))); } break; - case 126: -#line 760 "perly.y" /* yacc.c:1646 */ + case 142: +#line 1006 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_STACKED, op_append_elem(OP_LIST, (ps[-1].val.opval), newCVREF(0, scalar((ps[-4].val.opval))))); } break; - case 127: -#line 765 "perly.y" /* yacc.c:1646 */ + case 143: +#line 1011 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_STACKED, op_append_elem(OP_LIST, (ps[-1].val.opval), newCVREF(0, scalar((ps[-3].val.opval))))); } break; - case 128: -#line 769 "perly.y" /* yacc.c:1646 */ + case 144: +#line 1015 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_STACKED, newCVREF(0, scalar((ps[-2].val.opval)))); } break; - case 129: -#line 772 "perly.y" /* yacc.c:1646 */ + case 145: +#line 1018 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = newSLICEOP(0, (ps[-1].val.opval), (ps[-4].val.opval)); } break; - case 130: -#line 774 "perly.y" /* yacc.c:1646 */ + case 146: +#line 1020 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = newSLICEOP(0, (ps[-1].val.opval), (ps[-3].val.opval)); } break; - case 131: -#line 776 "perly.y" /* yacc.c:1646 */ + case 147: +#line 1022 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = newSLICEOP(0, (ps[-1].val.opval), (OP*)NULL); } break; - case 132: -#line 781 "perly.y" /* yacc.c:1646 */ + case 148: +#line 1027 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = newASSIGNOP(OPf_STACKED, (ps[-2].val.opval), (ps[-1].val.ival), (ps[0].val.opval)); } break; - case 133: -#line 783 "perly.y" /* yacc.c:1646 */ + case 149: +#line 1029 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = newBINOP((ps[-1].val.ival), 0, scalar((ps[-2].val.opval)), scalar((ps[0].val.opval))); } break; - case 134: -#line 785 "perly.y" /* yacc.c:1646 */ + case 150: +#line 1031 "perly.y" /* yacc.c:1646 */ { if ((ps[-1].val.ival) != OP_REPEAT) scalar((ps[-2].val.opval)); (yyval.opval) = newBINOP((ps[-1].val.ival), 0, (ps[-2].val.opval), scalar((ps[0].val.opval))); @@ -1059,112 +1332,112 @@ case 2: break; - case 135: -#line 790 "perly.y" /* yacc.c:1646 */ + case 151: +#line 1036 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = newBINOP((ps[-1].val.ival), 0, scalar((ps[-2].val.opval)), scalar((ps[0].val.opval))); } break; - case 136: -#line 792 "perly.y" /* yacc.c:1646 */ + case 152: +#line 1038 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = newBINOP((ps[-1].val.ival), 0, scalar((ps[-2].val.opval)), scalar((ps[0].val.opval))); } break; - case 137: -#line 794 "perly.y" /* yacc.c:1646 */ + case 153: +#line 1040 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = newBINOP((ps[-1].val.ival), 0, scalar((ps[-2].val.opval)), scalar((ps[0].val.opval))); } break; - case 138: -#line 796 "perly.y" /* yacc.c:1646 */ + case 154: +#line 1042 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = newBINOP((ps[-1].val.ival), 0, scalar((ps[-2].val.opval)), scalar((ps[0].val.opval))); } break; - case 139: -#line 798 "perly.y" /* yacc.c:1646 */ + case 155: +#line 1044 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = newBINOP((ps[-1].val.ival), 0, scalar((ps[-2].val.opval)), scalar((ps[0].val.opval))); } break; - case 140: -#line 800 "perly.y" /* yacc.c:1646 */ + case 156: +#line 1046 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = newBINOP((ps[-1].val.ival), 0, scalar((ps[-2].val.opval)), scalar((ps[0].val.opval))); } break; - case 141: -#line 802 "perly.y" /* yacc.c:1646 */ + case 157: +#line 1048 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = newRANGE((ps[-1].val.ival), scalar((ps[-2].val.opval)), scalar((ps[0].val.opval))); } break; - case 142: -#line 804 "perly.y" /* yacc.c:1646 */ + case 158: +#line 1050 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = newLOGOP(OP_AND, 0, (ps[-2].val.opval), (ps[0].val.opval)); } break; - case 143: -#line 806 "perly.y" /* yacc.c:1646 */ + case 159: +#line 1052 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = newLOGOP(OP_OR, 0, (ps[-2].val.opval), (ps[0].val.opval)); } break; - case 144: -#line 808 "perly.y" /* yacc.c:1646 */ + case 160: +#line 1054 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = newLOGOP(OP_DOR, 0, (ps[-2].val.opval), (ps[0].val.opval)); } break; - case 145: -#line 810 "perly.y" /* yacc.c:1646 */ + case 161: +#line 1056 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = bind_match((ps[-1].val.ival), (ps[-2].val.opval), (ps[0].val.opval)); } break; - case 146: -#line 815 "perly.y" /* yacc.c:1646 */ + case 162: +#line 1061 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = newUNOP(OP_NEGATE, 0, scalar((ps[0].val.opval))); } break; - case 147: -#line 817 "perly.y" /* yacc.c:1646 */ + case 163: +#line 1063 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = (ps[0].val.opval); } break; - case 148: -#line 820 "perly.y" /* yacc.c:1646 */ + case 164: +#line 1066 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = newUNOP(OP_NOT, 0, scalar((ps[0].val.opval))); } break; - case 149: -#line 822 "perly.y" /* yacc.c:1646 */ + case 165: +#line 1068 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = newUNOP((ps[-1].val.ival), 0, scalar((ps[0].val.opval))); } break; - case 150: -#line 824 "perly.y" /* yacc.c:1646 */ + case 166: +#line 1070 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = newUNOP(OP_POSTINC, 0, op_lvalue(scalar((ps[-1].val.opval)), OP_POSTINC)); } break; - case 151: -#line 827 "perly.y" /* yacc.c:1646 */ + case 167: +#line 1073 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = newUNOP(OP_POSTDEC, 0, op_lvalue(scalar((ps[-1].val.opval)), OP_POSTDEC));} break; - case 152: -#line 830 "perly.y" /* yacc.c:1646 */ + case 168: +#line 1076 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = op_convert_list(OP_JOIN, 0, op_append_elem( OP_LIST, @@ -1178,53 +1451,53 @@ case 2: break; - case 153: -#line 841 "perly.y" /* yacc.c:1646 */ + case 169: +#line 1087 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = newUNOP(OP_PREINC, 0, op_lvalue(scalar((ps[0].val.opval)), OP_PREINC)); } break; - case 154: -#line 844 "perly.y" /* yacc.c:1646 */ + case 170: +#line 1090 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = newUNOP(OP_PREDEC, 0, op_lvalue(scalar((ps[0].val.opval)), OP_PREDEC)); } break; - case 155: -#line 851 "perly.y" /* yacc.c:1646 */ + case 171: +#line 1097 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = newANONLIST((ps[-1].val.opval)); } break; - case 156: -#line 853 "perly.y" /* yacc.c:1646 */ + case 172: +#line 1099 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = newANONLIST((OP*)NULL);} break; - case 157: -#line 855 "perly.y" /* yacc.c:1646 */ + case 173: +#line 1101 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = newANONHASH((ps[-2].val.opval)); } break; - case 158: -#line 857 "perly.y" /* yacc.c:1646 */ + case 174: +#line 1103 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = newANONHASH((OP*)NULL); } break; - case 159: -#line 859 "perly.y" /* yacc.c:1646 */ + case 175: +#line 1105 "perly.y" /* yacc.c:1646 */ { SvREFCNT_inc_simple_void(PL_compcv); (yyval.opval) = newANONATTRSUB((ps[-3].val.ival), (ps[-2].val.opval), (ps[-1].val.opval), (ps[0].val.opval)); } break; - case 160: -#line 862 "perly.y" /* yacc.c:1646 */ + case 176: +#line 1108 "perly.y" /* yacc.c:1646 */ { OP *body; if (parser->copline > (line_t)(ps[-2].val.ival)) @@ -1237,104 +1510,104 @@ case 2: break; - case 161: -#line 876 "perly.y" /* yacc.c:1646 */ + case 177: +#line 1122 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = dofile((ps[0].val.opval), (ps[-1].val.ival));} break; - case 162: -#line 878 "perly.y" /* yacc.c:1646 */ + case 178: +#line 1124 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = newUNOP(OP_NULL, OPf_SPECIAL, op_scope((ps[0].val.opval)));} break; - case 167: -#line 886 "perly.y" /* yacc.c:1646 */ + case 183: +#line 1132 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = newCONDOP(0, (ps[-4].val.opval), (ps[-2].val.opval), (ps[0].val.opval)); } break; - case 168: -#line 888 "perly.y" /* yacc.c:1646 */ + case 184: +#line 1134 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = newUNOP(OP_REFGEN, 0, (ps[0].val.opval)); } break; - case 169: -#line 890 "perly.y" /* yacc.c:1646 */ + case 185: +#line 1136 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = newUNOP(OP_REFGEN, 0, localize((ps[0].val.opval),1)); } break; - case 170: -#line 892 "perly.y" /* yacc.c:1646 */ + case 186: +#line 1138 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = (ps[0].val.opval); } break; - case 171: -#line 894 "perly.y" /* yacc.c:1646 */ + case 187: +#line 1140 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = localize((ps[0].val.opval),0); } break; - case 172: -#line 896 "perly.y" /* yacc.c:1646 */ + case 188: +#line 1142 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = sawparens((ps[-1].val.opval)); } break; - case 173: -#line 898 "perly.y" /* yacc.c:1646 */ + case 189: +#line 1144 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = (ps[0].val.opval); } break; - case 174: -#line 900 "perly.y" /* yacc.c:1646 */ + case 190: +#line 1146 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = sawparens(newNULLLIST()); } break; - case 175: -#line 902 "perly.y" /* yacc.c:1646 */ + case 191: +#line 1148 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = (ps[0].val.opval); } break; - case 176: -#line 904 "perly.y" /* yacc.c:1646 */ + case 192: +#line 1150 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = (ps[0].val.opval); } break; - case 177: -#line 906 "perly.y" /* yacc.c:1646 */ + case 193: +#line 1152 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = (ps[0].val.opval); } break; - case 178: -#line 908 "perly.y" /* yacc.c:1646 */ + case 194: +#line 1154 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = (ps[0].val.opval); } break; - case 179: -#line 910 "perly.y" /* yacc.c:1646 */ + case 195: +#line 1156 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = newUNOP(OP_AV2ARYLEN, 0, ref((ps[0].val.opval), OP_AV2ARYLEN));} break; - case 180: -#line 912 "perly.y" /* yacc.c:1646 */ + case 196: +#line 1158 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = (ps[0].val.opval); } break; - case 181: -#line 914 "perly.y" /* yacc.c:1646 */ + case 197: +#line 1160 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = op_prepend_elem(OP_ASLICE, newOP(OP_PUSHMARK, 0), newLISTOP(OP_ASLICE, 0, @@ -1347,8 +1620,8 @@ case 2: break; - case 182: -#line 924 "perly.y" /* yacc.c:1646 */ + case 198: +#line 1170 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = op_prepend_elem(OP_KVASLICE, newOP(OP_PUSHMARK, 0), newLISTOP(OP_KVASLICE, 0, @@ -1361,8 +1634,8 @@ case 2: break; - case 183: -#line 934 "perly.y" /* yacc.c:1646 */ + case 199: +#line 1180 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = op_prepend_elem(OP_HSLICE, newOP(OP_PUSHMARK, 0), newLISTOP(OP_HSLICE, 0, @@ -1375,8 +1648,8 @@ case 2: break; - case 184: -#line 944 "perly.y" /* yacc.c:1646 */ + case 200: +#line 1190 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = op_prepend_elem(OP_KVHSLICE, newOP(OP_PUSHMARK, 0), newLISTOP(OP_KVHSLICE, 0, @@ -1389,27 +1662,27 @@ case 2: break; - case 185: -#line 954 "perly.y" /* yacc.c:1646 */ + case 201: +#line 1200 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = (ps[0].val.opval); } break; - case 186: -#line 956 "perly.y" /* yacc.c:1646 */ + case 202: +#line 1202 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = newUNOP(OP_ENTERSUB, 0, scalar((ps[0].val.opval))); } break; - case 187: -#line 958 "perly.y" /* yacc.c:1646 */ + case 203: +#line 1204 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_STACKED, scalar((ps[-2].val.opval))); } break; - case 188: -#line 961 "perly.y" /* yacc.c:1646 */ + case 204: +#line 1207 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_STACKED, op_append_elem(OP_LIST, (ps[-1].val.opval), scalar((ps[-3].val.opval)))); @@ -1417,153 +1690,153 @@ case 2: break; - case 189: -#line 966 "perly.y" /* yacc.c:1646 */ + case 205: +#line 1212 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_STACKED, op_append_elem(OP_LIST, (ps[0].val.opval), scalar((ps[-1].val.opval)))); } break; - case 190: -#line 970 "perly.y" /* yacc.c:1646 */ + case 206: +#line 1216 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = newSVREF((ps[-3].val.opval)); } break; - case 191: -#line 972 "perly.y" /* yacc.c:1646 */ + case 207: +#line 1218 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = newAVREF((ps[-3].val.opval)); } break; - case 192: -#line 974 "perly.y" /* yacc.c:1646 */ + case 208: +#line 1220 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = newHVREF((ps[-3].val.opval)); } break; - case 193: -#line 976 "perly.y" /* yacc.c:1646 */ + case 209: +#line 1222 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = newUNOP(OP_ENTERSUB, 0, scalar(newCVREF((ps[-1].val.ival),(ps[-3].val.opval)))); } break; - case 194: -#line 979 "perly.y" /* yacc.c:1646 */ + case 210: +#line 1225 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = newGVREF(0,(ps[-3].val.opval)); } break; - case 195: -#line 981 "perly.y" /* yacc.c:1646 */ + case 211: +#line 1227 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = newOP((ps[0].val.ival), OPf_SPECIAL); PL_hints |= HINT_BLOCK_SCOPE; } break; - case 196: -#line 984 "perly.y" /* yacc.c:1646 */ + case 212: +#line 1230 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = newLOOPEX((ps[-1].val.ival),(ps[0].val.opval)); } break; - case 197: -#line 986 "perly.y" /* yacc.c:1646 */ + case 213: +#line 1232 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = newUNOP(OP_NOT, 0, scalar((ps[0].val.opval))); } break; - case 198: -#line 988 "perly.y" /* yacc.c:1646 */ + case 214: +#line 1234 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = newOP((ps[0].val.ival), 0); } break; - case 199: -#line 990 "perly.y" /* yacc.c:1646 */ + case 215: +#line 1236 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = newUNOP((ps[-1].val.ival), 0, (ps[0].val.opval)); } break; - case 200: -#line 992 "perly.y" /* yacc.c:1646 */ + case 216: +#line 1238 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = newUNOP((ps[-1].val.ival), 0, (ps[0].val.opval)); } break; - case 201: -#line 994 "perly.y" /* yacc.c:1646 */ + case 217: +#line 1240 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = newOP(OP_REQUIRE, (ps[0].val.ival) ? OPf_SPECIAL : 0); } break; - case 202: -#line 996 "perly.y" /* yacc.c:1646 */ + case 218: +#line 1242 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = newUNOP(OP_REQUIRE, (ps[-1].val.ival) ? OPf_SPECIAL : 0, (ps[0].val.opval)); } break; - case 203: -#line 998 "perly.y" /* yacc.c:1646 */ + case 219: +#line 1244 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_STACKED, scalar((ps[0].val.opval))); } break; - case 204: -#line 1000 "perly.y" /* yacc.c:1646 */ + case 220: +#line 1246 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_STACKED, op_append_elem(OP_LIST, (ps[0].val.opval), scalar((ps[-1].val.opval)))); } break; - case 205: -#line 1003 "perly.y" /* yacc.c:1646 */ + case 221: +#line 1249 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = newOP((ps[0].val.ival), 0); } break; - case 206: -#line 1005 "perly.y" /* yacc.c:1646 */ + case 222: +#line 1251 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = newOP((ps[-2].val.ival), 0);} break; - case 207: -#line 1007 "perly.y" /* yacc.c:1646 */ + case 223: +#line 1253 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = (ps[0].val.opval); } break; - case 208: -#line 1009 "perly.y" /* yacc.c:1646 */ + case 224: +#line 1255 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = (ps[-2].val.opval); } break; - case 209: -#line 1011 "perly.y" /* yacc.c:1646 */ + case 225: +#line 1257 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_STACKED, scalar((ps[0].val.opval))); } break; - case 210: -#line 1013 "perly.y" /* yacc.c:1646 */ + case 226: +#line 1259 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = ((ps[-2].val.ival) == OP_NOT) ? newUNOP((ps[-2].val.ival), 0, newSVOP(OP_CONST, 0, newSViv(0))) : newOP((ps[-2].val.ival), OPf_SPECIAL); } break; - case 211: -#line 1017 "perly.y" /* yacc.c:1646 */ + case 227: +#line 1263 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = newUNOP((ps[-3].val.ival), 0, (ps[-1].val.opval)); } break; - case 212: -#line 1019 "perly.y" /* yacc.c:1646 */ + case 228: +#line 1265 "perly.y" /* yacc.c:1646 */ { if ( (ps[0].val.opval)->op_type != OP_TRANS && (ps[0].val.opval)->op_type != OP_TRANSR @@ -1577,14 +1850,14 @@ case 2: break; - case 213: -#line 1030 "perly.y" /* yacc.c:1646 */ + case 229: +#line 1276 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = pmruntime((ps[-5].val.opval), (ps[-2].val.opval), (ps[-1].val.opval), 1, (ps[-4].val.ival)); } break; - case 216: -#line 1034 "perly.y" /* yacc.c:1646 */ + case 232: +#line 1280 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = newLISTOP(OP_DIE, 0, newOP(OP_PUSHMARK, 0), newSVOP(OP_CONST, 0, newSVpvs("Unimplemented"))); @@ -1592,180 +1865,180 @@ case 2: break; - case 218: -#line 1043 "perly.y" /* yacc.c:1646 */ + case 234: +#line 1289 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = my_attrs((ps[-1].val.opval),(ps[0].val.opval)); } break; - case 219: -#line 1045 "perly.y" /* yacc.c:1646 */ + case 235: +#line 1291 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = localize((ps[0].val.opval),1); } break; - case 220: -#line 1047 "perly.y" /* yacc.c:1646 */ + case 236: +#line 1293 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = newUNOP(OP_REFGEN, 0, my_attrs((ps[-1].val.opval),(ps[0].val.opval))); } break; - case 221: -#line 1052 "perly.y" /* yacc.c:1646 */ + case 237: +#line 1298 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = sawparens((ps[-1].val.opval)); } break; - case 222: -#line 1054 "perly.y" /* yacc.c:1646 */ + case 238: +#line 1300 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = sawparens(newNULLLIST()); } break; - case 223: -#line 1057 "perly.y" /* yacc.c:1646 */ + case 239: +#line 1303 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = (ps[0].val.opval); } break; - case 224: -#line 1059 "perly.y" /* yacc.c:1646 */ + case 240: +#line 1305 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = (ps[0].val.opval); } break; - case 225: -#line 1061 "perly.y" /* yacc.c:1646 */ + case 241: +#line 1307 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = (ps[0].val.opval); } break; - case 226: -#line 1066 "perly.y" /* yacc.c:1646 */ + case 242: +#line 1312 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = (OP*)NULL; } break; - case 227: -#line 1068 "perly.y" /* yacc.c:1646 */ + case 243: +#line 1314 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = (ps[0].val.opval); } break; - case 228: -#line 1072 "perly.y" /* yacc.c:1646 */ + case 244: +#line 1318 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = (OP*)NULL; } break; - case 229: -#line 1074 "perly.y" /* yacc.c:1646 */ + case 245: +#line 1320 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = (ps[0].val.opval); } break; - case 230: -#line 1078 "perly.y" /* yacc.c:1646 */ + case 246: +#line 1324 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = (OP*)NULL; } break; - case 231: -#line 1080 "perly.y" /* yacc.c:1646 */ + case 247: +#line 1326 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = (ps[0].val.opval); } break; - case 232: -#line 1086 "perly.y" /* yacc.c:1646 */ + case 248: +#line 1332 "perly.y" /* yacc.c:1646 */ { parser->in_my = 0; (yyval.opval) = my((ps[0].val.opval)); } break; - case 240: -#line 1103 "perly.y" /* yacc.c:1646 */ + case 256: +#line 1349 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = newCVREF((ps[-1].val.ival),(ps[0].val.opval)); } break; - case 241: -#line 1107 "perly.y" /* yacc.c:1646 */ + case 257: +#line 1353 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = newSVREF((ps[0].val.opval)); } break; - case 242: -#line 1111 "perly.y" /* yacc.c:1646 */ + case 258: +#line 1357 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = newAVREF((ps[0].val.opval)); if ((yyval.opval)) (yyval.opval)->op_private |= (ps[-1].val.ival); } break; - case 243: -#line 1117 "perly.y" /* yacc.c:1646 */ + case 259: +#line 1363 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = newHVREF((ps[0].val.opval)); if ((yyval.opval)) (yyval.opval)->op_private |= (ps[-1].val.ival); } break; - case 244: -#line 1123 "perly.y" /* yacc.c:1646 */ + case 260: +#line 1369 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = newAVREF((ps[0].val.opval)); } break; - case 245: -#line 1125 "perly.y" /* yacc.c:1646 */ + case 261: +#line 1371 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = newAVREF((ps[-3].val.opval)); } break; - case 246: -#line 1129 "perly.y" /* yacc.c:1646 */ + case 262: +#line 1375 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = newGVREF(0,(ps[0].val.opval)); } break; - case 248: -#line 1134 "perly.y" /* yacc.c:1646 */ + case 264: +#line 1380 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = newAVREF((ps[-2].val.opval)); } break; - case 250: -#line 1139 "perly.y" /* yacc.c:1646 */ + case 266: +#line 1385 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = newHVREF((ps[-2].val.opval)); } break; - case 252: -#line 1144 "perly.y" /* yacc.c:1646 */ + case 268: +#line 1390 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = newGVREF(0,(ps[-2].val.opval)); } break; - case 253: -#line 1149 "perly.y" /* yacc.c:1646 */ + case 269: +#line 1395 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = scalar((ps[0].val.opval)); } break; - case 254: -#line 1151 "perly.y" /* yacc.c:1646 */ + case 270: +#line 1397 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = scalar((ps[0].val.opval)); } break; - case 255: -#line 1153 "perly.y" /* yacc.c:1646 */ + case 271: +#line 1399 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = op_scope((ps[0].val.opval)); } break; - case 256: -#line 1156 "perly.y" /* yacc.c:1646 */ + case 272: +#line 1402 "perly.y" /* yacc.c:1646 */ { (yyval.opval) = (ps[0].val.opval); } break; @@ -1776,6 +2049,6 @@ case 2: /* Generated from: - * fba24dfc68a3a84c9ae95cb9e14cc156ac487e6f3228cdf84c166d3cd820e59a perly.y + * 719f2ad40259ac9c064749d399f2c7d1e1131abbc8c1f1ec0558cac2d8f2bc4c perly.y * 3e1dff60f26df8933d7aed0c0e87177a0f022c14800c0707eb62a7db4196ac98 regen_perly.pl * ex: set ro: */ |