diff options
author | Father Chrysostomos <sprout@cpan.org> | 2012-07-05 23:22:21 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2012-09-15 22:44:57 -0700 |
commit | 5027875589574a2ca6c9fb86193d4c8f720ef004 (patch) | |
tree | 3e9dd7504ca98c4a28c71ba1baf65747cc4d2e0d /perly.h | |
parent | f37b842aabb9fad0fb5fe0a4803f30c6ead59c74 (diff) | |
download | perl-5027875589574a2ca6c9fb86193d4c8f720ef004.tar.gz |
Store state subs in the pad
In making ‘sub foo’ respect previous ‘our sub’ declarations in a
recent commit, I actually made ‘state sub foo’ into a syntax error.
(At the time, I patched up MYSUB in perly.y to keep the tests for ‘"my
sub" not yet implemented’ still working.) Basically, it was creat-
ing an empty pad entry, but returning something that perly.y was not
expecting.
This commit adjusts the grammar to allow the SUB branch of barestmt to
accept a PRIVATEREF for its subname, in addition to a WORD. It reuses
the subname rule that SUB used to use (before our subs were added),
gutting it to remove the special block handling, which SUB now tokes
care of. That means the MYSUB rule will no longer turn on CvSPECIAL
on the PL_compcv that is going to be thrown away anyway.
The code for special blocks (BEGIN, END, etc.) that turns on CvSPECIAL
now checks for state subs and skips those. It only applies to our
subs and package subs.
newMYSUB has now actually been written. It basically duplicates
newATTRSUB, except for GV-specific things. It does currently vivify a
GV and set CvGV, but I am hoping to change that later. I also hope to
merge some of the code later, too.
I changed the prototype of newMYSUB to make it easier to use. It is
not used anywhere on CPAN and has always simply died, so that should
be all right.
Diffstat (limited to 'perly.h')
-rw-r--r-- | perly.h | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -268,6 +268,6 @@ typedef union YYSTYPE /* Generated from: - * d37e00fcfb1737df464a95af8f4a92c2518ee5b69cd05ffc577f253313aa81c3 perly.y + * a216aadb9729f2e06283be0b4e7f08adc1209abb0bb9b50c453be450c6104a81 perly.y * 4a3ced51fe6585f6ec59e65e1ffd74bc976c498b0e6992eaab337219fee72e51 regen_perly.pl * ex: set ro: */ |