ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Devel-FindRef/FindRef.xs
(Generate patch)

Comparing Devel-FindRef/FindRef.xs (file contents):
Revision 1.6 by root, Sat Dec 29 21:04:46 2007 UTC vs.
Revision 1.7 by root, Sat Apr 26 03:15:28 2008 UTC

14 14
15#define res_pair(text) \ 15#define res_pair(text) \
16 { \ 16 { \
17 AV *av = newAV (); \ 17 AV *av = newAV (); \
18 av_push (av, newSVpv (text, 0)); \ 18 av_push (av, newSVpv (text, 0)); \
19 if (rmagical) SvRMAGICAL_on (sv); \
19 av_push (av, sv_rvweaken (newRV_inc (sv))); \ 20 av_push (av, sv_rvweaken (newRV_inc (sv))); \
21 if (rmagical) SvRMAGICAL_off (sv); \
20 av_push (about, newRV_noinc ((SV *)av)); \ 22 av_push (about, newRV_noinc ((SV *)av)); \
21 } 23 }
22 24
23#define res_gv(sigil) \ 25#define res_gv(sigil) \
24 { \ 26 { \
117 119
118 case SVt_PVCV: 120 case SVt_PVCV:
119 { 121 {
120 int depth = CvDEPTH (sv); 122 int depth = CvDEPTH (sv);
121 123
124 if (!depth && CvPADLIST(sv))
125 depth = 1;
126
122 if (depth) 127 if (depth)
123 { 128 {
124 AV *padlist = CvPADLIST (sv); 129 AV *padlist = CvPADLIST (sv);
125 130
126 while (depth) 131 while (depth)
127 { 132 {
128 AV *pad = (AV *)AvARRAY (padlist)[depth]; 133 AV *pad = (AV *)AvARRAY (padlist)[depth];
129 134
130 av_push (excl, newSVuv (PTR2UV (pad))); /* exclude pads themselves from being found */ 135 av_push (excl, newSVuv (PTR2UV (pad))); /* exclude pads themselves from being found */
131 136
132 for (i = AvFILLp (pad); i--; ) 137 for (i = AvFILLp (pad) + 1; i--; )
133 if (AvARRAY (pad)[i] == targ) 138 if (AvARRAY (pad)[i] == targ)
134 res_pair (form ("in the lexical '%s' in", SvPVX (AvARRAY (AvARRAY (padlist)[0])[i]))); 139 res_pair (form ("in the lexical '%s' in", SvPVX (AvARRAY (AvARRAY (padlist)[0])[i])));
135 140
136 --depth; 141 --depth;
137 } 142 }
138 } 143 }
144
145 if ((SV*)CvOUTSIDE(sv) == targ)
146 res_pair ("the containing scope for");
139 } 147 }
140 148
141 break; 149 break;
142 150
143 case SVt_PVGV: 151 case SVt_PVGV:

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines