diff options
author | Zefram <zefram@fysh.org> | 2014-02-01 01:27:13 +0000 |
---|---|---|
committer | Zefram <zefram@fysh.org> | 2014-02-01 01:27:15 +0000 |
commit | 30d9c59b5f3cba8b5d632d20c2370e82d8ba69ca (patch) | |
tree | 989db43c82b395cec053b341532db7a145827254 /perly.act | |
parent | ef463b6d87c1ce4e4946bdf785d47e481c1f33f2 (diff) | |
download | perl-30d9c59b5f3cba8b5d632d20c2370e82d8ba69ca.tar.gz |
subroutine signatures
Declarative syntax to unwrap argument list into lexical variables.
"sub foo ($a,$b) {...}" checks number of arguments and puts the
arguments into lexical variables. Signatures are not equivalent to the
existing idiom of "sub foo { my($a,$b) = @_; ... }". Signatures are only
available by enabling a non-default feature, and generate warnings about
being experimental. The syntactic clash with prototypes is managed by
disabling the short prototype syntax when signatures are enabled.
Diffstat (limited to 'perly.act')
-rw-r--r-- | perly.act | 573 |
1 files changed, 306 insertions, 267 deletions
@@ -760,11 +760,50 @@ case 2: case 90: #line 732 "perly.y" - { (yyval.opval) = (ps[(1) - (1)].val.opval); } + { (yyval.opval) = (OP*)NULL; } break; case 91: -#line 733 "perly.y" +#line 734 "perly.y" + { + if (!FEATURE_SIGNATURES_IS_ENABLED) + Perl_croak(aTHX_ "Experimental " + "subroutine signatures not enabled"); + Perl_ck_warner_d(aTHX_ + packWARN(WARN_EXPERIMENTAL__SIGNATURES), + "The signatures feature is experimental"); + (yyval.opval) = parse_subsignature(); + } + break; + + case 92: +#line 744 "perly.y" + { + (yyval.opval) = op_append_list(OP_LINESEQ, (ps[(2) - (3)].val.opval), + newSTATEOP(0, NULL, sawparens(newNULLLIST()))); + PL_parser->expect = XBLOCK; + } + break; + + case 93: +#line 753 "perly.y" + { + if (PL_parser->copline > (line_t)IVAL((ps[(3) - (5)].val.i_tkval))) + PL_parser->copline = (line_t)IVAL((ps[(3) - (5)].val.i_tkval)); + (yyval.opval) = block_end((ps[(1) - (5)].val.ival), + op_append_list(OP_LINESEQ, (ps[(2) - (5)].val.opval), (ps[(4) - (5)].val.opval))); + TOKEN_GETMAD((ps[(3) - (5)].val.i_tkval),(yyval.opval),'{'); + TOKEN_GETMAD((ps[(5) - (5)].val.i_tkval),(yyval.opval),'}'); + } + break; + + case 94: +#line 764 "perly.y" + { (yyval.opval) = (ps[(1) - (1)].val.opval); } + break; + + case 95: +#line 765 "perly.y" { (yyval.opval) = IF_MAD( newOP(OP_NULL,0), (OP*)NULL @@ -774,29 +813,29 @@ case 2: } break; - case 92: -#line 744 "perly.y" + case 96: +#line 776 "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 93: -#line 748 "perly.y" + case 97: +#line 780 "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 94: -#line 752 "perly.y" + case 98: +#line 784 "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 96: -#line 760 "perly.y" + case 100: +#line 792 "perly.y" { #ifdef MAD OP* op = newNULLLIST(); @@ -808,8 +847,8 @@ case 2: } break; - case 97: -#line 770 "perly.y" + case 101: +#line 802 "perly.y" { OP* term = (ps[(3) - (3)].val.opval); DO_MAD( @@ -820,16 +859,16 @@ case 2: } break; - case 99: -#line 783 "perly.y" + case 103: +#line 815 "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'); } break; - case 100: -#line 788 "perly.y" + case 104: +#line 820 "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'); @@ -838,8 +877,8 @@ case 2: } break; - case 101: -#line 795 "perly.y" + case 105: +#line 827 "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)), @@ -850,8 +889,8 @@ case 2: } break; - case 102: -#line 804 "perly.y" + case 106: +#line 836 "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)))); @@ -859,8 +898,8 @@ case 2: } break; - case 103: -#line 810 "perly.y" + case 107: +#line 842 "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)), @@ -868,8 +907,8 @@ case 2: } break; - case 104: -#line 816 "perly.y" + case 108: +#line 848 "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)), @@ -879,15 +918,15 @@ case 2: } break; - case 105: -#line 824 "perly.y" + case 109: +#line 856 "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 106: -#line 828 "perly.y" + case 110: +#line 860 "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),'('); @@ -895,22 +934,22 @@ case 2: } break; - case 107: -#line 834 "perly.y" + case 111: +#line 866 "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 108: -#line 837 "perly.y" + case 112: +#line 869 "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))); } break; - case 111: -#line 852 "perly.y" + case 115: +#line 884 "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),'{'); @@ -919,16 +958,16 @@ case 2: } break; - case 112: -#line 859 "perly.y" + case 116: +#line 891 "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),']'); } break; - case 113: -#line 864 "perly.y" + case 117: +#line 896 "perly.y" { (yyval.opval) = newBINOP(OP_AELEM, 0, ref(newAVREF((ps[(1) - (5)].val.opval)),OP_RV2AV), scalar((ps[(4) - (5)].val.opval))); @@ -938,8 +977,8 @@ case 2: } break; - case 114: -#line 872 "perly.y" + case 118: +#line 904 "perly.y" { (yyval.opval) = newBINOP(OP_AELEM, 0, ref(newAVREF((ps[(1) - (4)].val.opval)),OP_RV2AV), scalar((ps[(3) - (4)].val.opval))); @@ -948,8 +987,8 @@ case 2: } break; - case 115: -#line 879 "perly.y" + case 119: +#line 911 "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),'{'); @@ -958,8 +997,8 @@ case 2: } break; - case 116: -#line 886 "perly.y" + case 120: +#line 918 "perly.y" { (yyval.opval) = newBINOP(OP_HELEM, 0, ref(newHVREF((ps[(1) - (6)].val.opval)),OP_RV2HV), jmaybe((ps[(4) - (6)].val.opval))); @@ -971,8 +1010,8 @@ case 2: } break; - case 117: -#line 896 "perly.y" + case 121: +#line 928 "perly.y" { (yyval.opval) = newBINOP(OP_HELEM, 0, ref(newHVREF((ps[(1) - (5)].val.opval)),OP_RV2HV), jmaybe((ps[(3) - (5)].val.opval))); @@ -983,8 +1022,8 @@ case 2: } break; - case 118: -#line 905 "perly.y" + case 122: +#line 937 "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'); @@ -993,8 +1032,8 @@ case 2: } break; - case 119: -#line 912 "perly.y" + case 123: +#line 944 "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))))); @@ -1004,8 +1043,8 @@ case 2: } break; - case 120: -#line 921 "perly.y" + case 124: +#line 953 "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))))); @@ -1014,8 +1053,8 @@ case 2: } break; - case 121: -#line 928 "perly.y" + case 125: +#line 960 "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),'('); @@ -1023,8 +1062,8 @@ case 2: } break; - case 122: -#line 934 "perly.y" + case 126: +#line 966 "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),')'); @@ -1033,16 +1072,16 @@ case 2: } break; - case 123: -#line 941 "perly.y" + case 127: +#line 973 "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),']'); } break; - case 124: -#line 946 "perly.y" + case 128: +#line 978 "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),')'); @@ -1051,22 +1090,22 @@ case 2: } break; - case 125: -#line 956 "perly.y" + case 129: +#line 988 "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 126: -#line 960 "perly.y" + case 130: +#line 992 "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 964 "perly.y" + case 131: +#line 996 "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))); @@ -1074,50 +1113,50 @@ case 2: } break; - case 128: -#line 970 "perly.y" + case 132: +#line 1002 "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 129: -#line 974 "perly.y" + case 133: +#line 1006 "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 130: -#line 978 "perly.y" + case 134: +#line 1010 "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 131: -#line 982 "perly.y" + case 135: +#line 1014 "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 132: -#line 986 "perly.y" + case 136: +#line 1018 "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 133: -#line 990 "perly.y" + case 137: +#line 1022 "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 134: -#line 994 "perly.y" + case 138: +#line 1026 "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({ @@ -1131,29 +1170,29 @@ case 2: } break; - case 135: -#line 1006 "perly.y" + case 139: +#line 1038 "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 136: -#line 1010 "perly.y" + case 140: +#line 1042 "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 137: -#line 1014 "perly.y" + case 141: +#line 1046 "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 138: -#line 1018 "perly.y" + case 142: +#line 1050 "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 @@ -1162,15 +1201,15 @@ case 2: } break; - case 139: -#line 1028 "perly.y" + case 143: +#line 1060 "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 140: -#line 1032 "perly.y" + case 144: +#line 1064 "perly.y" { (yyval.opval) = IF_MAD( newUNOP(OP_NULL, 0, (ps[(2) - (2)].val.opval)), (ps[(2) - (2)].val.opval) @@ -1179,38 +1218,38 @@ case 2: } break; - case 141: -#line 1039 "perly.y" + case 145: +#line 1071 "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 142: -#line 1043 "perly.y" + case 146: +#line 1075 "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 143: -#line 1047 "perly.y" + case 147: +#line 1079 "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'); } break; - case 144: -#line 1052 "perly.y" + case 148: +#line 1084 "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'); } break; - case 145: -#line 1057 "perly.y" + case 149: +#line 1089 "perly.y" { (yyval.opval) = convert(OP_JOIN, 0, op_append_elem( OP_LIST, @@ -1224,40 +1263,40 @@ case 2: } break; - case 146: -#line 1069 "perly.y" + case 150: +#line 1101 "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'); } break; - case 147: -#line 1074 "perly.y" + case 151: +#line 1106 "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'); } break; - case 148: -#line 1083 "perly.y" + case 152: +#line 1115 "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),']'); } break; - case 149: -#line 1088 "perly.y" + case 153: +#line 1120 "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),']'); } break; - case 150: -#line 1093 "perly.y" + case 154: +#line 1125 "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),';'); @@ -1265,8 +1304,8 @@ case 2: } break; - case 151: -#line 1099 "perly.y" + case 155: +#line 1131 "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),';'); @@ -1274,8 +1313,8 @@ case 2: } break; - case 152: -#line 1105 "perly.y" + case 156: +#line 1137 "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'); @@ -1284,100 +1323,100 @@ case 2: } break; - case 153: -#line 1116 "perly.y" + case 157: +#line 1148 "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 154: -#line 1120 "perly.y" + case 158: +#line 1152 "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 159: -#line 1130 "perly.y" + case 163: +#line 1162 "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),':'); } break; - case 160: -#line 1135 "perly.y" + case 164: +#line 1167 "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 161: -#line 1139 "perly.y" + case 165: +#line 1171 "perly.y" { (yyval.opval) = (ps[(1) - (1)].val.opval); } break; - case 162: -#line 1141 "perly.y" + case 166: +#line 1173 "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 163: -#line 1145 "perly.y" + case 167: +#line 1177 "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),')'); } break; - case 164: -#line 1150 "perly.y" + case 168: +#line 1182 "perly.y" { (yyval.opval) = IF_MAD(newUNOP(OP_NULL,0,(ps[(1) - (1)].val.opval)), (ps[(1) - (1)].val.opval)); } break; - case 165: -#line 1152 "perly.y" + case 169: +#line 1184 "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),')'); } break; - case 166: -#line 1157 "perly.y" + case 170: +#line 1189 "perly.y" { (yyval.opval) = (ps[(1) - (1)].val.opval); } break; - case 167: -#line 1159 "perly.y" + case 171: +#line 1191 "perly.y" { (yyval.opval) = (ps[(1) - (1)].val.opval); } break; - case 168: -#line 1161 "perly.y" + case 172: +#line 1193 "perly.y" { (yyval.opval) = (ps[(1) - (1)].val.opval); } break; - case 169: -#line 1163 "perly.y" + case 173: +#line 1195 "perly.y" { (yyval.opval) = (ps[(1) - (1)].val.opval); } break; - case 170: -#line 1165 "perly.y" + case 174: +#line 1197 "perly.y" { (yyval.opval) = newUNOP(OP_AV2ARYLEN, 0, ref((ps[(1) - (1)].val.opval), OP_AV2ARYLEN));} break; - case 171: -#line 1167 "perly.y" + case 175: +#line 1199 "perly.y" { (yyval.opval) = (ps[(1) - (1)].val.opval); } break; - case 172: -#line 1169 "perly.y" + case 176: +#line 1201 "perly.y" { (yyval.opval) = op_prepend_elem(OP_ASLICE, newOP(OP_PUSHMARK, 0), newLISTOP(OP_ASLICE, 0, @@ -1391,8 +1430,8 @@ case 2: } break; - case 173: -#line 1181 "perly.y" + case 177: +#line 1213 "perly.y" { (yyval.opval) = op_prepend_elem(OP_KVASLICE, newOP(OP_PUSHMARK, 0), newLISTOP(OP_KVASLICE, 0, @@ -1406,8 +1445,8 @@ case 2: } break; - case 174: -#line 1193 "perly.y" + case 178: +#line 1225 "perly.y" { (yyval.opval) = op_prepend_elem(OP_HSLICE, newOP(OP_PUSHMARK, 0), newLISTOP(OP_HSLICE, 0, @@ -1423,8 +1462,8 @@ case 2: } break; - case 175: -#line 1207 "perly.y" + case 179: +#line 1239 "perly.y" { (yyval.opval) = op_prepend_elem(OP_KVHSLICE, newOP(OP_PUSHMARK, 0), newLISTOP(OP_KVHSLICE, 0, @@ -1440,26 +1479,26 @@ case 2: } break; - case 176: -#line 1221 "perly.y" + case 180: +#line 1253 "perly.y" { (yyval.opval) = (ps[(1) - (1)].val.opval); } break; - case 177: -#line 1223 "perly.y" + case 181: +#line 1255 "perly.y" { (yyval.opval) = newUNOP(OP_ENTERSUB, 0, scalar((ps[(1) - (1)].val.opval))); } break; - case 178: -#line 1225 "perly.y" + case 182: +#line 1257 "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),')'); } break; - case 179: -#line 1230 "perly.y" + case 183: +#line 1262 "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)))); @@ -1474,127 +1513,127 @@ case 2: } break; - case 180: -#line 1243 "perly.y" + case 184: +#line 1275 "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'); } break; - case 181: -#line 1248 "perly.y" + case 185: +#line 1280 "perly.y" { (yyval.opval) = newSVREF((ps[(1) - (4)].val.opval)); TOKEN_GETMAD((ps[(3) - (4)].val.i_tkval),(yyval.opval),'$'); } break; - case 182: -#line 1252 "perly.y" + case 186: +#line 1284 "perly.y" { (yyval.opval) = newAVREF((ps[(1) - (4)].val.opval)); TOKEN_GETMAD((ps[(3) - (4)].val.i_tkval),(yyval.opval),'@'); } break; - case 183: -#line 1256 "perly.y" + case 187: +#line 1288 "perly.y" { (yyval.opval) = newHVREF((ps[(1) - (4)].val.opval)); TOKEN_GETMAD((ps[(3) - (4)].val.i_tkval),(yyval.opval),'%'); } break; - case 184: -#line 1260 "perly.y" + case 188: +#line 1292 "perly.y" { (yyval.opval) = newUNOP(OP_ENTERSUB, 0, scalar(newCVREF(IVAL((ps[(3) - (4)].val.i_tkval)),(ps[(1) - (4)].val.opval)))); TOKEN_GETMAD((ps[(3) - (4)].val.i_tkval),(yyval.opval),'&'); } break; - case 185: -#line 1265 "perly.y" + case 189: +#line 1297 "perly.y" { (yyval.opval) = newGVREF(0,(ps[(1) - (4)].val.opval)); TOKEN_GETMAD((ps[(3) - (4)].val.i_tkval),(yyval.opval),'*'); } break; - case 186: -#line 1269 "perly.y" + case 190: +#line 1301 "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'); } break; - case 187: -#line 1274 "perly.y" + case 191: +#line 1306 "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 188: -#line 1278 "perly.y" + case 192: +#line 1310 "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 189: -#line 1282 "perly.y" + case 193: +#line 1314 "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 190: -#line 1286 "perly.y" + case 194: +#line 1318 "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 191: -#line 1290 "perly.y" + case 195: +#line 1322 "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 192: -#line 1294 "perly.y" + case 196: +#line 1326 "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 193: -#line 1298 "perly.y" + case 197: +#line 1330 "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 194: -#line 1302 "perly.y" + case 198: +#line 1334 "perly.y" { (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_STACKED, scalar((ps[(1) - (1)].val.opval))); } break; - case 195: -#line 1304 "perly.y" + case 199: +#line 1336 "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 196: -#line 1307 "perly.y" + case 200: +#line 1339 "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 197: -#line 1311 "perly.y" + case 201: +#line 1343 "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),'('); @@ -1602,27 +1641,27 @@ case 2: } break; - case 198: -#line 1317 "perly.y" + case 202: +#line 1349 "perly.y" { (yyval.opval) = (ps[(1) - (1)].val.opval); } break; - case 199: -#line 1319 "perly.y" + case 203: +#line 1351 "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),')'); } break; - case 200: -#line 1324 "perly.y" + case 204: +#line 1356 "perly.y" { (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_STACKED, scalar((ps[(1) - (1)].val.opval))); } break; - case 201: -#line 1327 "perly.y" + case 205: +#line 1359 "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); @@ -1633,8 +1672,8 @@ case 2: } break; - case 202: -#line 1336 "perly.y" + case 206: +#line 1368 "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),'('); @@ -1642,8 +1681,8 @@ case 2: } break; - case 203: -#line 1342 "perly.y" + case 207: +#line 1374 "perly.y" { if ( (ps[(1) - (1)].val.opval)->op_type != OP_TRANS && (ps[(1) - (1)].val.opval)->op_type != OP_TRANSR @@ -1656,16 +1695,16 @@ case 2: } break; - case 204: -#line 1353 "perly.y" + case 208: +#line 1385 "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),')'); } break; - case 207: -#line 1360 "perly.y" + case 211: +#line 1392 "perly.y" { (yyval.opval) = newLISTOP(OP_DIE, 0, newOP(OP_PUSHMARK, 0), newSVOP(OP_CONST, 0, newSVpvs("Unimplemented"))); @@ -1673,8 +1712,8 @@ case 2: } break; - case 209: -#line 1370 "perly.y" + case 213: +#line 1402 "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'); @@ -1684,158 +1723,158 @@ case 2: } break; - case 210: -#line 1378 "perly.y" + case 214: +#line 1410 "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 211: -#line 1385 "perly.y" + case 215: +#line 1417 "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),')'); } break; - case 212: -#line 1390 "perly.y" + case 216: +#line 1422 "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),')'); } break; - case 213: -#line 1395 "perly.y" + case 217: +#line 1427 "perly.y" { (yyval.opval) = (ps[(1) - (1)].val.opval); } break; - case 214: -#line 1397 "perly.y" + case 218: +#line 1429 "perly.y" { (yyval.opval) = (ps[(1) - (1)].val.opval); } break; - case 215: -#line 1399 "perly.y" + case 219: +#line 1431 "perly.y" { (yyval.opval) = (ps[(1) - (1)].val.opval); } break; - case 216: -#line 1404 "perly.y" + case 220: +#line 1436 "perly.y" { (yyval.opval) = (OP*)NULL; } break; - case 217: -#line 1406 "perly.y" + case 221: +#line 1438 "perly.y" { (yyval.opval) = (ps[(1) - (1)].val.opval); } break; - case 218: -#line 1410 "perly.y" + case 222: +#line 1442 "perly.y" { (yyval.opval) = (OP*)NULL; } break; - case 219: -#line 1412 "perly.y" + case 223: +#line 1444 "perly.y" { (yyval.opval) = (ps[(1) - (1)].val.opval); } break; - case 220: -#line 1418 "perly.y" + case 224: +#line 1450 "perly.y" { PL_parser->in_my = 0; (yyval.opval) = my((ps[(1) - (1)].val.opval)); } break; - case 221: -#line 1422 "perly.y" + case 225: +#line 1454 "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 222: -#line 1428 "perly.y" + case 226: +#line 1460 "perly.y" { (yyval.opval) = newSVREF((ps[(2) - (2)].val.opval)); TOKEN_GETMAD((ps[(1) - (2)].val.i_tkval),(yyval.opval),'$'); } break; - case 223: -#line 1434 "perly.y" + case 227: +#line 1466 "perly.y" { (yyval.opval) = newAVREF((ps[(2) - (2)].val.opval)); if ((yyval.opval)) (yyval.opval)->op_private |= IVAL((ps[(1) - (2)].val.i_tkval)); TOKEN_GETMAD((ps[(1) - (2)].val.i_tkval),(yyval.opval),'@'); } break; - case 224: -#line 1441 "perly.y" + case 228: +#line 1473 "perly.y" { (yyval.opval) = newHVREF((ps[(2) - (2)].val.opval)); if ((yyval.opval)) (yyval.opval)->op_private |= IVAL((ps[(1) - (2)].val.i_tkval)); TOKEN_GETMAD((ps[(1) - (2)].val.i_tkval),(yyval.opval),'%'); } break; - case 225: -#line 1448 "perly.y" + case 229: +#line 1480 "perly.y" { (yyval.opval) = newAVREF((ps[(2) - (2)].val.opval)); TOKEN_GETMAD((ps[(1) - (2)].val.i_tkval),(yyval.opval),'l'); } break; - case 226: -#line 1452 "perly.y" + case 230: +#line 1484 "perly.y" { (yyval.opval) = newAVREF((ps[(1) - (4)].val.opval)); TOKEN_GETMAD((ps[(3) - (4)].val.i_tkval),(yyval.opval),'l'); } break; - case 227: -#line 1458 "perly.y" + case 231: +#line 1490 "perly.y" { (yyval.opval) = newGVREF(0,(ps[(2) - (2)].val.opval)); TOKEN_GETMAD((ps[(1) - (2)].val.i_tkval),(yyval.opval),'*'); } break; - case 229: -#line 1465 "perly.y" + case 233: +#line 1497 "perly.y" { (yyval.opval) = newAVREF((ps[(1) - (3)].val.opval)); TOKEN_GETMAD((ps[(3) - (3)].val.i_tkval),(yyval.opval),'@'); } break; - case 231: -#line 1472 "perly.y" + case 235: +#line 1504 "perly.y" { (yyval.opval) = newHVREF((ps[(1) - (3)].val.opval)); TOKEN_GETMAD((ps[(3) - (3)].val.i_tkval),(yyval.opval),'@'); } break; - case 233: -#line 1479 "perly.y" + case 237: +#line 1511 "perly.y" { (yyval.opval) = newGVREF(0,(ps[(1) - (3)].val.opval)); TOKEN_GETMAD((ps[(3) - (3)].val.i_tkval),(yyval.opval),'*'); } break; - case 234: -#line 1486 "perly.y" + case 238: +#line 1518 "perly.y" { (yyval.opval) = scalar((ps[(1) - (1)].val.opval)); } break; - case 235: -#line 1488 "perly.y" + case 239: +#line 1520 "perly.y" { (yyval.opval) = scalar((ps[(1) - (1)].val.opval)); } break; - case 236: -#line 1490 "perly.y" + case 240: +#line 1522 "perly.y" { (yyval.opval) = op_scope((ps[(1) - (1)].val.opval)); } break; - case 237: -#line 1493 "perly.y" + case 241: +#line 1525 "perly.y" { (yyval.opval) = (ps[(1) - (1)].val.opval); } break; @@ -1843,6 +1882,6 @@ case 2: /* Generated from: - * 911fbbcab275e0f9645397ee5b80a7c2384e6b24f793c15e6d6e918ebfd4e384 perly.y + * bb8245a1a537b2afb2445b3973f63b210f9ec346a1955071aef7d05ba97196ae perly.y * 5c9d2a0262457fe9b70073fc8ad6c188f812f38ad57712b7e2f53daa01b297cc regen_perly.pl * ex: set ro: */ |