… | |
… | |
37 | av_push (av, newSVpv (text, 0)); \ |
37 | av_push (av, newSVpv (text, 0)); \ |
38 | av_push (about, newRV_noinc ((SV *)av)); \ |
38 | av_push (about, newRV_noinc ((SV *)av)); \ |
39 | } while (0) |
39 | } while (0) |
40 | |
40 | |
41 | #define res_gv(sigil) \ |
41 | #define res_gv(sigil) \ |
42 | res_text (form ("in the global %c%s::%.*s", sigil, \ |
42 | res_text (form ("the global %c%s::%.*s", sigil, \ |
43 | HvNAME (GvSTASH (sv)), \ |
43 | HvNAME (GvSTASH (sv)), \ |
44 | GvNAME_HEK (sv) ? GvNAMELEN (sv) : 11, \ |
44 | GvNAME_HEK (sv) ? GvNAMELEN (sv) : 11, \ |
45 | GvNAME_HEK (sv) ? GvNAME (sv) : "<anonymous>")) |
45 | GvNAME_HEK (sv) ? GvNAME (sv) : "<anonymous>")) |
46 | |
46 | |
47 | MODULE = Devel::FindRef PACKAGE = Devel::FindRef |
47 | MODULE = Devel::FindRef PACKAGE = Devel::FindRef |
… | |
… | |
132 | { |
132 | { |
133 | case SVt_PVAV: |
133 | case SVt_PVAV: |
134 | if (AvREAL (sv)) |
134 | if (AvREAL (sv)) |
135 | for (i = AvFILLp (sv) + 1; i--; ) |
135 | for (i = AvFILLp (sv) + 1; i--; ) |
136 | if (AvARRAY (sv)[i] == targ) |
136 | if (AvARRAY (sv)[i] == targ) |
137 | res_pair (form ("in array element %d of", i)); |
137 | res_pair (form ("the array element %d of", i)); |
138 | |
138 | |
139 | break; |
139 | break; |
140 | |
140 | |
141 | case SVt_PVHV: |
141 | case SVt_PVHV: |
142 | if (hv_iterinit ((HV *)sv)) |
142 | if (hv_iterinit ((HV *)sv)) |
143 | { |
143 | { |
144 | HE *he; |
144 | HE *he; |
145 | |
145 | |
146 | while ((he = hv_iternext ((HV *)sv))) |
146 | while ((he = hv_iternext ((HV *)sv))) |
147 | if (HeVAL (he) == targ) |
147 | if (HeVAL (he) == targ) |
148 | res_pair (form ("in the member '%.*s' of", HeKLEN (he), HeKEY (he))); |
148 | res_pair (form ("the member '%.*s' of", HeKLEN (he), HeKEY (he))); |
149 | } |
149 | } |
150 | |
150 | |
151 | break; |
151 | break; |
152 | |
152 | |
153 | case SVt_PVCV: |
153 | case SVt_PVCV: |
… | |
… | |
177 | { |
177 | { |
178 | /* Values from constant functions are stored in the pad without any name */ |
178 | /* Values from constant functions are stored in the pad without any name */ |
179 | SV *name_sv = AvARRAY (AvARRAY (padlist)[0])[i]; |
179 | SV *name_sv = AvARRAY (AvARRAY (padlist)[0])[i]; |
180 | |
180 | |
181 | if (name_sv && SvPOK (name_sv)) |
181 | if (name_sv && SvPOK (name_sv)) |
182 | res_pair (form ("in the lexical '%s' in", SvPVX (name_sv))); |
182 | res_pair (form ("the lexical '%s' in", SvPVX (name_sv))); |
183 | else |
183 | else |
184 | res_pair ("in an unnamed lexical in"); |
184 | res_pair ("an unnamed lexical in"); |
185 | } |
185 | } |
186 | |
186 | |
187 | --depth; |
187 | --depth; |
188 | } |
188 | } |
189 | } |
189 | } |