summaryrefslogtreecommitdiff
path: root/perly.y
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2012-07-04 09:13:17 -0700
committerFather Chrysostomos <sprout@cpan.org>2012-09-15 22:44:55 -0700
commit4210d3f17cf9d854c0cbf0e1afb06e737174f8ea (patch)
treeefc39119656264c3e86de28179261818b5c201e9 /perly.y
parent60ac52eb5d5157fbe18e603a2d72ef6249b62083 (diff)
downloadperl-4210d3f17cf9d854c0cbf0e1afb06e737174f8ea.tar.gz
Make ‘sub foo{}’ respect ‘our foo’
This commit switches all sub definitions, whether with ‘our’ or not, to using S_force_ident_maybe_lex (formerly known as S_pending_ident). This means that an unqualified (no our/my/state or package prefix) ‘sub foo’ declaration does a pad lookup, just like $foo. It turns out that the vivification that I added to the then S_pending_ident for CVs was unnecessary and actually buggy. We *don’t* want to autovivify GVs for CVs, because they might be con- stants or forward declarations, which are stored in a simpler form. I also had to change the subname rule used by MYSUB in perly.y, since it can now be fed a PRIVATEREF, which it does not expect. This may prove to be temporary, but it keeps current tests passing.
Diffstat (limited to 'perly.y')
-rw-r--r--perly.y1
1 files changed, 1 insertions, 0 deletions
diff --git a/perly.y b/perly.y
index 2634605b86..a091d3d8d5 100644
--- a/perly.y
+++ b/perly.y
@@ -684,6 +684,7 @@ subname : WORD { const char *const name = SvPV_nolen_const(((SVOP*)$1)->op_sv);
|| strEQ(name, "UNITCHECK"))
CvSPECIAL_on(PL_compcv);
$$ = $1; }
+ | PRIVATEREF
;
/* Subroutine prototype */