diff options
author | David Golden <dagolden@cpan.org> | 2009-10-06 06:48:48 -0400 |
---|---|---|
committer | David Golden <dagolden@cpan.org> | 2009-10-06 12:41:09 -0400 |
commit | 6fa4d285bff5644bebb95aff09143322042282cc (patch) | |
tree | 3e353ca1e3a17967f6dd473bcb49a7269c880355 /perly.act | |
parent | cc4c9faad0767bbb62e32c96638b5ce02dde234e (diff) | |
download | perl-6fa4d285bff5644bebb95aff09143322042282cc.tar.gz |
Add 'package NAME VERSION' syntax
This patch adds support for setting the $VERSION of a namespace
when the namespace is declared with 'package'. It eliminates the
need for 'our $VERSION = ...' and similar constructs. E.g.
package Foo::Bar 1.23;
# $Foo::Bar::VERSION == 1.23
There are several advantages to this:
* VERSION is parsed in *exactly* the same way as 'use NAME VERSION'
* $VERSION is set at compile time
* Eliminates '$VERSION = ...' and 'eval $VERSION' clutter
* As it requires VERSION to be a numeric literal or v-string
literal, it can be statically parsed by toolchain modules
without 'eval' the way MM->parse_version does for '$VERSION = ...'
* Alpha versions with underscores do not need to be quoted; static
parsing will preserve the underscore, but during compilation, Perl
will remove underscores as it does for all numeric literals
During development of this, there was discussion on #corehackers and
elsewhere that this should also allow other metadata to be set such as
"status" (stable/alpha) or "author/authority". On reflection, those
metadata are not very well defined yet and likely should never be
encoded into Perl core parsing so they can be freely changed in the
future. (They could perhaps be achieved via a comment on the same line
as 'package NAME VERSION'.)
Version numbers, however, already have a very specific definition and
use defined in the core through 'use NAME VERSION'. This patch merely
provides appropriate symmetry for setting $VERSION with the exact same
parsing and semantics as 'use'.
It does not break old code with only 'package NAME', but code that
uses 'package NAME VERSION' will need to be restricted to perl 5.11.X.
This is analogous to the change to open() from two-args to three-args.
Users requiring the latest Perl will benefit, and perhaps N years from
now it will become standard practice when Perl 5.12 is targeted the
way that 5.6 is today.
The patch does not prevent 'package NAME VERSION' from being used
multiple times for the same package with different version numbers, but
nothing prevents $VERSION from being modified arbitrarily at runtime,
either, so I see no urgen reason to add limitations or warnings so
long as Perl uses a global $VERSION variable for package version
numbers.
I am posting this patch to the p5p list for discussion and review. If
there seems to be general assent (or lack of dissent), I will go ahead
and commit the patch to blead.
Diffstat (limited to 'perly.act')
-rw-r--r-- | perly.act | 258 |
1 files changed, 129 insertions, 129 deletions
@@ -605,24 +605,21 @@ case 2: case 79: #line 637 "perly.y" { -#ifdef MAD - (yyval.opval) = package((ps[(2) - (3)].val.opval)); - token_getmad((ps[(1) - (3)].val.i_tkval),(yyval.opval),'o'); - token_getmad((ps[(3) - (3)].val.i_tkval),(yyval.opval),';'); -#else - package((ps[(2) - (3)].val.opval)); + package((ps[(3) - (4)].val.opval)); + if ((ps[(2) - (4)].val.opval)) { + package_version((ps[(2) - (4)].val.opval)); + } (yyval.opval) = (OP*)NULL; -#endif ;} break; case 80: -#line 650 "perly.y" +#line 647 "perly.y" { CvSPECIAL_on(PL_compcv); /* It's a BEGIN {} */ ;} break; case 81: -#line 652 "perly.y" +#line 649 "perly.y" { SvREFCNT_inc_simple_void(PL_compcv); #ifdef MAD (yyval.opval) = utilize(IVAL((ps[(1) - (7)].val.i_tkval)), (ps[(2) - (7)].val.ival), (ps[(4) - (7)].val.opval), (ps[(5) - (7)].val.opval), (ps[(6) - (7)].val.opval)); @@ -639,28 +636,28 @@ case 2: break; case 82: -#line 669 "perly.y" +#line 666 "perly.y" { (yyval.opval) = newLOGOP(OP_AND, 0, (ps[(1) - (3)].val.opval), (ps[(3) - (3)].val.opval)); TOKEN_GETMAD((ps[(2) - (3)].val.i_tkval),(yyval.opval),'o'); ;} break; case 83: -#line 673 "perly.y" +#line 670 "perly.y" { (yyval.opval) = newLOGOP(IVAL((ps[(2) - (3)].val.i_tkval)), 0, (ps[(1) - (3)].val.opval), (ps[(3) - (3)].val.opval)); TOKEN_GETMAD((ps[(2) - (3)].val.i_tkval),(yyval.opval),'o'); ;} break; case 84: -#line 677 "perly.y" +#line 674 "perly.y" { (yyval.opval) = newLOGOP(OP_DOR, 0, (ps[(1) - (3)].val.opval), (ps[(3) - (3)].val.opval)); TOKEN_GETMAD((ps[(2) - (3)].val.i_tkval),(yyval.opval),'o'); ;} break; case 86: -#line 685 "perly.y" +#line 682 "perly.y" { #ifdef MAD OP* op = newNULLLIST(); @@ -673,7 +670,7 @@ case 2: break; case 87: -#line 695 "perly.y" +#line 692 "perly.y" { OP* term = (ps[(3) - (3)].val.opval); DO_MAD( @@ -685,7 +682,7 @@ case 2: break; case 89: -#line 708 "perly.y" +#line 705 "perly.y" { (yyval.opval) = convert(IVAL((ps[(1) - (3)].val.i_tkval)), OPf_STACKED, prepend_elem(OP_LIST, newGVREF(IVAL((ps[(1) - (3)].val.i_tkval)),(ps[(2) - (3)].val.opval)), (ps[(3) - (3)].val.opval)) ); TOKEN_GETMAD((ps[(1) - (3)].val.i_tkval),(yyval.opval),'o'); @@ -693,7 +690,7 @@ case 2: break; case 90: -#line 713 "perly.y" +#line 710 "perly.y" { (yyval.opval) = convert(IVAL((ps[(1) - (5)].val.i_tkval)), OPf_STACKED, prepend_elem(OP_LIST, newGVREF(IVAL((ps[(1) - (5)].val.i_tkval)),(ps[(3) - (5)].val.opval)), (ps[(4) - (5)].val.opval)) ); TOKEN_GETMAD((ps[(1) - (5)].val.i_tkval),(yyval.opval),'o'); @@ -703,7 +700,7 @@ case 2: break; case 91: -#line 720 "perly.y" +#line 717 "perly.y" { (yyval.opval) = convert(OP_ENTERSUB, OPf_STACKED, append_elem(OP_LIST, prepend_elem(OP_LIST, scalar((ps[(1) - (6)].val.opval)), (ps[(5) - (6)].val.opval)), @@ -715,7 +712,7 @@ case 2: break; case 92: -#line 729 "perly.y" +#line 726 "perly.y" { (yyval.opval) = convert(OP_ENTERSUB, OPf_STACKED, append_elem(OP_LIST, scalar((ps[(1) - (3)].val.opval)), newUNOP(OP_METHOD, 0, (ps[(3) - (3)].val.opval)))); @@ -724,7 +721,7 @@ case 2: break; case 93: -#line 735 "perly.y" +#line 732 "perly.y" { (yyval.opval) = convert(OP_ENTERSUB, OPf_STACKED, append_elem(OP_LIST, prepend_elem(OP_LIST, (ps[(2) - (3)].val.opval), (ps[(3) - (3)].val.opval)), @@ -733,7 +730,7 @@ case 2: break; case 94: -#line 741 "perly.y" +#line 738 "perly.y" { (yyval.opval) = convert(OP_ENTERSUB, OPf_STACKED, append_elem(OP_LIST, prepend_elem(OP_LIST, (ps[(2) - (5)].val.opval), (ps[(4) - (5)].val.opval)), @@ -744,14 +741,14 @@ case 2: break; case 95: -#line 749 "perly.y" +#line 746 "perly.y" { (yyval.opval) = convert(IVAL((ps[(1) - (2)].val.i_tkval)), 0, (ps[(2) - (2)].val.opval)); TOKEN_GETMAD((ps[(1) - (2)].val.i_tkval),(yyval.opval),'o'); ;} break; case 96: -#line 753 "perly.y" +#line 750 "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),'('); @@ -760,13 +757,13 @@ case 2: break; case 97: -#line 759 "perly.y" +#line 756 "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 98: -#line 762 "perly.y" +#line 759 "perly.y" { (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_STACKED, append_elem(OP_LIST, prepend_elem(OP_LIST, (ps[(4) - (5)].val.opval), (ps[(5) - (5)].val.opval)), (ps[(1) - (5)].val.opval))); @@ -774,7 +771,7 @@ case 2: break; case 101: -#line 777 "perly.y" +#line 774 "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),'{'); @@ -784,7 +781,7 @@ case 2: break; case 102: -#line 784 "perly.y" +#line 781 "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),']'); @@ -792,7 +789,7 @@ case 2: break; case 103: -#line 789 "perly.y" +#line 786 "perly.y" { (yyval.opval) = newBINOP(OP_AELEM, 0, ref(newAVREF((ps[(1) - (5)].val.opval)),OP_RV2AV), scalar((ps[(4) - (5)].val.opval))); @@ -803,7 +800,7 @@ case 2: break; case 104: -#line 797 "perly.y" +#line 794 "perly.y" { (yyval.opval) = newBINOP(OP_AELEM, 0, ref(newAVREF((ps[(1) - (4)].val.opval)),OP_RV2AV), scalar((ps[(3) - (4)].val.opval))); @@ -813,7 +810,7 @@ case 2: break; case 105: -#line 804 "perly.y" +#line 801 "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),'{'); @@ -823,7 +820,7 @@ case 2: break; case 106: -#line 811 "perly.y" +#line 808 "perly.y" { (yyval.opval) = newBINOP(OP_HELEM, 0, ref(newHVREF((ps[(1) - (6)].val.opval)),OP_RV2HV), jmaybe((ps[(4) - (6)].val.opval))); @@ -836,7 +833,7 @@ case 2: break; case 107: -#line 821 "perly.y" +#line 818 "perly.y" { (yyval.opval) = newBINOP(OP_HELEM, 0, ref(newHVREF((ps[(1) - (5)].val.opval)),OP_RV2HV), jmaybe((ps[(3) - (5)].val.opval))); @@ -848,7 +845,7 @@ case 2: break; case 108: -#line 830 "perly.y" +#line 827 "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'); @@ -858,7 +855,7 @@ case 2: break; case 109: -#line 837 "perly.y" +#line 834 "perly.y" { (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_STACKED, append_elem(OP_LIST, (ps[(4) - (5)].val.opval), newCVREF(0, scalar((ps[(1) - (5)].val.opval))))); @@ -869,7 +866,7 @@ case 2: break; case 110: -#line 846 "perly.y" +#line 843 "perly.y" { (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_STACKED, append_elem(OP_LIST, (ps[(3) - (4)].val.opval), newCVREF(0, scalar((ps[(1) - (4)].val.opval))))); @@ -879,7 +876,7 @@ case 2: break; case 111: -#line 853 "perly.y" +#line 850 "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),'('); @@ -888,7 +885,7 @@ case 2: break; case 112: -#line 859 "perly.y" +#line 856 "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),')'); @@ -898,7 +895,7 @@ case 2: break; case 113: -#line 866 "perly.y" +#line 863 "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),')'); @@ -908,21 +905,21 @@ case 2: break; case 114: -#line 876 "perly.y" +#line 873 "perly.y" { (yyval.opval) = newASSIGNOP(OPf_STACKED, (ps[(1) - (3)].val.opval), IVAL((ps[(2) - (3)].val.i_tkval)), (ps[(3) - (3)].val.opval)); TOKEN_GETMAD((ps[(2) - (3)].val.i_tkval),(yyval.opval),'o'); ;} break; case 115: -#line 880 "perly.y" +#line 877 "perly.y" { (yyval.opval) = newBINOP(IVAL((ps[(2) - (3)].val.i_tkval)), 0, scalar((ps[(1) - (3)].val.opval)), scalar((ps[(3) - (3)].val.opval))); TOKEN_GETMAD((ps[(2) - (3)].val.i_tkval),(yyval.opval),'o'); ;} break; case 116: -#line 884 "perly.y" +#line 881 "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))); @@ -931,49 +928,49 @@ case 2: break; case 117: -#line 890 "perly.y" +#line 887 "perly.y" { (yyval.opval) = newBINOP(IVAL((ps[(2) - (3)].val.i_tkval)), 0, scalar((ps[(1) - (3)].val.opval)), scalar((ps[(3) - (3)].val.opval))); TOKEN_GETMAD((ps[(2) - (3)].val.i_tkval),(yyval.opval),'o'); ;} break; case 118: -#line 894 "perly.y" +#line 891 "perly.y" { (yyval.opval) = newBINOP(IVAL((ps[(2) - (3)].val.i_tkval)), 0, scalar((ps[(1) - (3)].val.opval)), scalar((ps[(3) - (3)].val.opval))); TOKEN_GETMAD((ps[(2) - (3)].val.i_tkval),(yyval.opval),'o'); ;} break; case 119: -#line 898 "perly.y" +#line 895 "perly.y" { (yyval.opval) = newBINOP(IVAL((ps[(2) - (3)].val.i_tkval)), 0, scalar((ps[(1) - (3)].val.opval)), scalar((ps[(3) - (3)].val.opval))); TOKEN_GETMAD((ps[(2) - (3)].val.i_tkval),(yyval.opval),'o'); ;} break; case 120: -#line 902 "perly.y" +#line 899 "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 906 "perly.y" +#line 903 "perly.y" { (yyval.opval) = newBINOP(IVAL((ps[(2) - (3)].val.i_tkval)), 0, scalar((ps[(1) - (3)].val.opval)), scalar((ps[(3) - (3)].val.opval))); TOKEN_GETMAD((ps[(2) - (3)].val.i_tkval),(yyval.opval),'o'); ;} break; case 122: -#line 910 "perly.y" +#line 907 "perly.y" { (yyval.opval) = newBINOP(IVAL((ps[(2) - (3)].val.i_tkval)), 0, scalar((ps[(1) - (3)].val.opval)), scalar((ps[(3) - (3)].val.opval))); TOKEN_GETMAD((ps[(2) - (3)].val.i_tkval),(yyval.opval),'o'); ;} break; case 123: -#line 914 "perly.y" +#line 911 "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({ @@ -988,28 +985,28 @@ case 2: break; case 124: -#line 926 "perly.y" +#line 923 "perly.y" { (yyval.opval) = newLOGOP(OP_AND, 0, (ps[(1) - (3)].val.opval), (ps[(3) - (3)].val.opval)); TOKEN_GETMAD((ps[(2) - (3)].val.i_tkval),(yyval.opval),'o'); ;} break; case 125: -#line 930 "perly.y" +#line 927 "perly.y" { (yyval.opval) = newLOGOP(OP_OR, 0, (ps[(1) - (3)].val.opval), (ps[(3) - (3)].val.opval)); TOKEN_GETMAD((ps[(2) - (3)].val.i_tkval),(yyval.opval),'o'); ;} break; case 126: -#line 934 "perly.y" +#line 931 "perly.y" { (yyval.opval) = newLOGOP(OP_DOR, 0, (ps[(1) - (3)].val.opval), (ps[(3) - (3)].val.opval)); TOKEN_GETMAD((ps[(2) - (3)].val.i_tkval),(yyval.opval),'o'); ;} break; case 127: -#line 938 "perly.y" +#line 935 "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 @@ -1019,14 +1016,14 @@ case 2: break; case 128: -#line 948 "perly.y" +#line 945 "perly.y" { (yyval.opval) = newUNOP(OP_NEGATE, 0, scalar((ps[(2) - (2)].val.opval))); TOKEN_GETMAD((ps[(1) - (2)].val.i_tkval),(yyval.opval),'o'); ;} break; case 129: -#line 952 "perly.y" +#line 949 "perly.y" { (yyval.opval) = IF_MAD( newUNOP(OP_NULL, 0, (ps[(2) - (2)].val.opval)), (ps[(2) - (2)].val.opval) @@ -1036,21 +1033,21 @@ case 2: break; case 130: -#line 959 "perly.y" +#line 956 "perly.y" { (yyval.opval) = newUNOP(OP_NOT, 0, scalar((ps[(2) - (2)].val.opval))); TOKEN_GETMAD((ps[(1) - (2)].val.i_tkval),(yyval.opval),'o'); ;} break; case 131: -#line 963 "perly.y" +#line 960 "perly.y" { (yyval.opval) = newUNOP(OP_COMPLEMENT, 0, scalar((ps[(2) - (2)].val.opval))); TOKEN_GETMAD((ps[(1) - (2)].val.i_tkval),(yyval.opval),'o'); ;} break; case 132: -#line 967 "perly.y" +#line 964 "perly.y" { (yyval.opval) = newUNOP(OP_POSTINC, 0, mod(scalar((ps[(1) - (2)].val.opval)), OP_POSTINC)); TOKEN_GETMAD((ps[(2) - (2)].val.i_tkval),(yyval.opval),'o'); @@ -1058,7 +1055,7 @@ case 2: break; case 133: -#line 972 "perly.y" +#line 969 "perly.y" { (yyval.opval) = newUNOP(OP_POSTDEC, 0, mod(scalar((ps[(1) - (2)].val.opval)), OP_POSTDEC)); TOKEN_GETMAD((ps[(2) - (2)].val.i_tkval),(yyval.opval),'o'); @@ -1066,7 +1063,7 @@ case 2: break; case 134: -#line 977 "perly.y" +#line 974 "perly.y" { (yyval.opval) = newUNOP(OP_PREINC, 0, mod(scalar((ps[(2) - (2)].val.opval)), OP_PREINC)); TOKEN_GETMAD((ps[(1) - (2)].val.i_tkval),(yyval.opval),'o'); @@ -1074,7 +1071,7 @@ case 2: break; case 135: -#line 982 "perly.y" +#line 979 "perly.y" { (yyval.opval) = newUNOP(OP_PREDEC, 0, mod(scalar((ps[(2) - (2)].val.opval)), OP_PREDEC)); TOKEN_GETMAD((ps[(1) - (2)].val.i_tkval),(yyval.opval),'o'); @@ -1082,7 +1079,7 @@ case 2: break; case 136: -#line 991 "perly.y" +#line 988 "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),']'); @@ -1090,7 +1087,7 @@ case 2: break; case 137: -#line 996 "perly.y" +#line 993 "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),']'); @@ -1098,7 +1095,7 @@ case 2: break; case 138: -#line 1001 "perly.y" +#line 998 "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),';'); @@ -1107,7 +1104,7 @@ case 2: break; case 139: -#line 1007 "perly.y" +#line 1004 "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),';'); @@ -1116,7 +1113,7 @@ case 2: break; case 140: -#line 1013 "perly.y" +#line 1010 "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'); @@ -1126,21 +1123,21 @@ case 2: break; case 141: -#line 1024 "perly.y" +#line 1021 "perly.y" { (yyval.opval) = dofile((ps[(2) - (2)].val.opval), IVAL((ps[(1) - (2)].val.i_tkval))); TOKEN_GETMAD((ps[(1) - (2)].val.i_tkval),(yyval.opval),'o'); ;} break; case 142: -#line 1028 "perly.y" +#line 1025 "perly.y" { (yyval.opval) = newUNOP(OP_NULL, OPf_SPECIAL, scope((ps[(2) - (2)].val.opval))); TOKEN_GETMAD((ps[(1) - (2)].val.i_tkval),(yyval.opval),'D'); ;} break; case 143: -#line 1032 "perly.y" +#line 1029 "perly.y" { (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_SPECIAL|OPf_STACKED, prepend_elem(OP_LIST, @@ -1155,7 +1152,7 @@ case 2: break; case 144: -#line 1044 "perly.y" +#line 1041 "perly.y" { (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_SPECIAL|OPf_STACKED, append_elem(OP_LIST, @@ -1171,7 +1168,7 @@ case 2: break; case 145: -#line 1057 "perly.y" +#line 1054 "perly.y" { (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_SPECIAL|OPf_STACKED, prepend_elem(OP_LIST, scalar(newCVREF(0,scalar((ps[(2) - (4)].val.opval)))), (OP*)NULL)); dep(); @@ -1182,7 +1179,7 @@ case 2: break; case 146: -#line 1065 "perly.y" +#line 1062 "perly.y" { (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_SPECIAL|OPf_STACKED, prepend_elem(OP_LIST, (ps[(4) - (5)].val.opval), @@ -1194,7 +1191,7 @@ case 2: break; case 151: -#line 1081 "perly.y" +#line 1078 "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),':'); @@ -1202,26 +1199,26 @@ case 2: break; case 152: -#line 1086 "perly.y" +#line 1083 "perly.y" { (yyval.opval) = newUNOP(OP_REFGEN, 0, mod((ps[(2) - (2)].val.opval),OP_REFGEN)); TOKEN_GETMAD((ps[(1) - (2)].val.i_tkval),(yyval.opval),'o'); ;} break; case 153: -#line 1090 "perly.y" +#line 1087 "perly.y" { (yyval.opval) = (ps[(1) - (1)].val.opval); ;} break; case 154: -#line 1092 "perly.y" +#line 1089 "perly.y" { (yyval.opval) = localize((ps[(2) - (2)].val.opval),IVAL((ps[(1) - (2)].val.i_tkval))); TOKEN_GETMAD((ps[(1) - (2)].val.i_tkval),(yyval.opval),'k'); ;} break; case 155: -#line 1096 "perly.y" +#line 1093 "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),')'); @@ -1229,7 +1226,7 @@ case 2: break; case 156: -#line 1101 "perly.y" +#line 1098 "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),')'); @@ -1237,37 +1234,37 @@ case 2: break; case 157: -#line 1106 "perly.y" +#line 1103 "perly.y" { (yyval.opval) = (ps[(1) - (1)].val.opval); ;} break; case 158: -#line 1108 "perly.y" +#line 1105 "perly.y" { (yyval.opval) = (ps[(1) - (1)].val.opval); ;} break; case 159: -#line 1110 "perly.y" +#line 1107 "perly.y" { (yyval.opval) = (ps[(1) - (1)].val.opval); ;} break; case 160: -#line 1112 "perly.y" +#line 1109 "perly.y" { (yyval.opval) = (ps[(1) - (1)].val.opval); ;} break; case 161: -#line 1114 "perly.y" +#line 1111 "perly.y" { (yyval.opval) = newUNOP(OP_AV2ARYLEN, 0, ref((ps[(1) - (1)].val.opval), OP_AV2ARYLEN));;} break; case 162: -#line 1116 "perly.y" +#line 1113 "perly.y" { (yyval.opval) = (ps[(1) - (1)].val.opval); ;} break; case 163: -#line 1118 "perly.y" +#line 1115 "perly.y" { (yyval.opval) = prepend_elem(OP_ASLICE, newOP(OP_PUSHMARK, 0), newLISTOP(OP_ASLICE, 0, @@ -1279,7 +1276,7 @@ case 2: break; case 164: -#line 1127 "perly.y" +#line 1124 "perly.y" { (yyval.opval) = prepend_elem(OP_HSLICE, newOP(OP_PUSHMARK, 0), newLISTOP(OP_HSLICE, 0, @@ -1293,17 +1290,17 @@ case 2: break; case 165: -#line 1138 "perly.y" +#line 1135 "perly.y" { (yyval.opval) = (ps[(1) - (1)].val.opval); ;} break; case 166: -#line 1140 "perly.y" +#line 1137 "perly.y" { (yyval.opval) = newUNOP(OP_ENTERSUB, 0, scalar((ps[(1) - (1)].val.opval))); ;} break; case 167: -#line 1142 "perly.y" +#line 1139 "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),')'); @@ -1311,7 +1308,7 @@ case 2: break; case 168: -#line 1147 "perly.y" +#line 1144 "perly.y" { (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_STACKED, append_elem(OP_LIST, (ps[(3) - (4)].val.opval), scalar((ps[(1) - (4)].val.opval)))); @@ -1327,7 +1324,7 @@ case 2: break; case 169: -#line 1160 "perly.y" +#line 1157 "perly.y" { (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_STACKED, append_elem(OP_LIST, (ps[(3) - (3)].val.opval), scalar((ps[(2) - (3)].val.opval)))); TOKEN_GETMAD((ps[(1) - (3)].val.i_tkval),(yyval.opval),'o'); @@ -1335,7 +1332,7 @@ case 2: break; case 170: -#line 1165 "perly.y" +#line 1162 "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'); @@ -1343,74 +1340,74 @@ case 2: break; case 171: -#line 1170 "perly.y" +#line 1167 "perly.y" { (yyval.opval) = newLOOPEX(IVAL((ps[(1) - (2)].val.i_tkval)),(ps[(2) - (2)].val.opval)); TOKEN_GETMAD((ps[(1) - (2)].val.i_tkval),(yyval.opval),'o'); ;} break; case 172: -#line 1174 "perly.y" +#line 1171 "perly.y" { (yyval.opval) = newUNOP(OP_NOT, 0, scalar((ps[(2) - (2)].val.opval))); TOKEN_GETMAD((ps[(1) - (2)].val.i_tkval),(yyval.opval),'o'); ;} break; case 173: -#line 1178 "perly.y" +#line 1175 "perly.y" { (yyval.opval) = newOP(IVAL((ps[(1) - (1)].val.i_tkval)), 0); TOKEN_GETMAD((ps[(1) - (1)].val.i_tkval),(yyval.opval),'o'); ;} break; case 174: -#line 1182 "perly.y" +#line 1179 "perly.y" { (yyval.opval) = newUNOP(IVAL((ps[(1) - (2)].val.i_tkval)), 0, (ps[(2) - (2)].val.opval)); TOKEN_GETMAD((ps[(1) - (2)].val.i_tkval),(yyval.opval),'o'); ;} break; case 175: -#line 1186 "perly.y" +#line 1183 "perly.y" { (yyval.opval) = newUNOP(IVAL((ps[(1) - (2)].val.i_tkval)), 0, (ps[(2) - (2)].val.opval)); TOKEN_GETMAD((ps[(1) - (2)].val.i_tkval),(yyval.opval),'o'); ;} break; case 176: -#line 1190 "perly.y" +#line 1187 "perly.y" { (yyval.opval) = newOP(OP_REQUIRE, (ps[(1) - (1)].val.i_tkval) ? OPf_SPECIAL : 0); TOKEN_GETMAD((ps[(1) - (1)].val.i_tkval),(yyval.opval),'o'); ;} break; case 177: -#line 1194 "perly.y" +#line 1191 "perly.y" { (yyval.opval) = newUNOP(OP_REQUIRE, (ps[(1) - (2)].val.i_tkval) ? OPf_SPECIAL : 0, (ps[(2) - (2)].val.opval)); TOKEN_GETMAD((ps[(1) - (2)].val.i_tkval),(yyval.opval),'o'); ;} break; case 178: -#line 1198 "perly.y" +#line 1195 "perly.y" { (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_STACKED, scalar((ps[(1) - (1)].val.opval))); ;} break; case 179: -#line 1200 "perly.y" +#line 1197 "perly.y" { (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_STACKED, append_elem(OP_LIST, (ps[(2) - (2)].val.opval), scalar((ps[(1) - (2)].val.opval)))); ;} break; case 180: -#line 1203 "perly.y" +#line 1200 "perly.y" { (yyval.opval) = newOP(IVAL((ps[(1) - (1)].val.i_tkval)), 0); TOKEN_GETMAD((ps[(1) - (1)].val.i_tkval),(yyval.opval),'o'); ;} break; case 181: -#line 1207 "perly.y" +#line 1204 "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),'('); @@ -1419,13 +1416,13 @@ case 2: break; case 182: -#line 1213 "perly.y" +#line 1210 "perly.y" { (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_STACKED, scalar((ps[(1) - (1)].val.opval))); ;} break; case 183: -#line 1216 "perly.y" +#line 1213 "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); @@ -1437,7 +1434,7 @@ case 2: break; case 184: -#line 1225 "perly.y" +#line 1222 "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),'('); @@ -1446,7 +1443,7 @@ case 2: break; case 185: -#line 1231 "perly.y" +#line 1228 "perly.y" { (yyval.opval) = pmruntime((ps[(1) - (4)].val.opval), (ps[(3) - (4)].val.opval), 1); TOKEN_GETMAD((ps[(2) - (4)].val.i_tkval),(yyval.opval),'('); TOKEN_GETMAD((ps[(4) - (4)].val.i_tkval),(yyval.opval),')'); @@ -1454,7 +1451,7 @@ case 2: break; case 188: -#line 1238 "perly.y" +#line 1235 "perly.y" { (yyval.opval) = newLISTOP(OP_DIE, 0, newOP(OP_PUSHMARK, 0), newSVOP(OP_CONST, 0, newSVpvs("Unimplemented"))); @@ -1463,7 +1460,7 @@ case 2: break; case 189: -#line 1247 "perly.y" +#line 1244 "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'); @@ -1474,14 +1471,14 @@ case 2: break; case 190: -#line 1255 "perly.y" +#line 1252 "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 191: -#line 1262 "perly.y" +#line 1259 "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),')'); @@ -1489,7 +1486,7 @@ case 2: break; case 192: -#line 1267 "perly.y" +#line 1264 "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),')'); @@ -1497,42 +1494,42 @@ case 2: break; case 193: -#line 1272 "perly.y" +#line 1269 "perly.y" { (yyval.opval) = (ps[(1) - (1)].val.opval); ;} break; case 194: -#line 1274 "perly.y" +#line 1271 "perly.y" { (yyval.opval) = (ps[(1) - (1)].val.opval); ;} break; case 195: -#line 1276 "perly.y" +#line 1273 "perly.y" { (yyval.opval) = (ps[(1) - (1)].val.opval); ;} break; case 196: -#line 1281 "perly.y" +#line 1278 "perly.y" { (yyval.opval) = (OP*)NULL; ;} break; case 197: -#line 1283 "perly.y" +#line 1280 "perly.y" { (yyval.opval) = (ps[(1) - (1)].val.opval); ;} break; case 198: -#line 1287 "perly.y" +#line 1284 "perly.y" { (yyval.opval) = (OP*)NULL; ;} break; case 199: -#line 1289 "perly.y" +#line 1286 "perly.y" { (yyval.opval) = (ps[(1) - (1)].val.opval); ;} break; case 200: -#line 1291 "perly.y" +#line 1288 "perly.y" { #ifdef MAD OP* op = newNULLLIST(); @@ -1546,71 +1543,74 @@ case 2: break; case 201: -#line 1306 "perly.y" +#line 1303 "perly.y" { PL_parser->in_my = 0; (yyval.opval) = my((ps[(1) - (1)].val.opval)); ;} break; case 202: -#line 1310 "perly.y" +#line 1307 "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 203: -#line 1316 "perly.y" +#line 1313 "perly.y" { (yyval.opval) = newSVREF((ps[(2) - (2)].val.opval)); TOKEN_GETMAD((ps[(1) - (2)].val.i_tkval),(yyval.opval),'$'); ;} break; case 204: -#line 1322 "perly.y" +#line 1319 "perly.y" { (yyval.opval) = newAVREF((ps[(2) - (2)].val.opval)); TOKEN_GETMAD((ps[(1) - (2)].val.i_tkval),(yyval.opval),'@'); ;} break; case 205: -#line 1328 "perly.y" +#line 1325 "perly.y" { (yyval.opval) = newHVREF((ps[(2) - (2)].val.opval)); TOKEN_GETMAD((ps[(1) - (2)].val.i_tkval),(yyval.opval),'%'); ;} break; case 206: -#line 1334 "perly.y" +#line 1331 "perly.y" { (yyval.opval) = newAVREF((ps[(2) - (2)].val.opval)); TOKEN_GETMAD((ps[(1) - (2)].val.i_tkval),(yyval.opval),'l'); ;} break; case 207: -#line 1340 "perly.y" +#line 1337 "perly.y" { (yyval.opval) = newGVREF(0,(ps[(2) - (2)].val.opval)); TOKEN_GETMAD((ps[(1) - (2)].val.i_tkval),(yyval.opval),'*'); ;} break; case 208: -#line 1347 "perly.y" +#line 1344 "perly.y" { (yyval.opval) = scalar((ps[(1) - (1)].val.opval)); ;} break; case 209: -#line 1349 "perly.y" +#line 1346 "perly.y" { (yyval.opval) = scalar((ps[(1) - (1)].val.opval)); ;} break; case 210: -#line 1351 "perly.y" +#line 1348 "perly.y" { (yyval.opval) = scope((ps[(1) - (1)].val.opval)); ;} break; case 211: -#line 1354 "perly.y" +#line 1351 "perly.y" { (yyval.opval) = (ps[(1) - (1)].val.opval); ;} break; + +/* Line 1267 of yacc.c. */ + default: break; |