| 1 |
|
| #include "Scope.h" |
| 2 |
|
| #include "Simple.h" |
| 3 |
|
| |
| 4 |
|
| namespace xs { |
| 5 |
|
| |
| 6 |
|
| using panda::string_view; |
| 7 |
|
| |
| 8 |
4 |
| void Scope::Hints::set (string_view name, const Sv& value) { |
| 9 |
4 |
▶ | auto copy = Sv::create(); |
Branch: 1 branch
| Branch | True | False | Total |
| auto copy = Sv::create(); |
4 |
0 |
4 |
|
| 10 |
4 |
▶ | sv_setsv(copy, value); |
Branch: 1 branch
| Branch | True | False | Total |
| sv_setsv(copy, value); |
4 |
0 |
4 |
|
| 11 |
|
| |
| 12 |
4 |
| auto hv = GvHV(PL_hintgv); |
| 13 |
4 |
▶ | auto he = hv_store_ent(hv, Simple(name), copy.detach(), 0); |
Branch: 2 branches
| Branch | True | False | Total |
| auto he = hv_store_ent(hv, Simple(name), copy.detach(), 0); |
4 |
0 |
4 |
| auto he = hv_store_ent(hv, Simple(name), copy.detach(), 0); |
4 |
0 |
4 |
|
| 14 |
4 |
| PL_hints |= HINT_LOCALIZE_HH; |
| 15 |
|
| |
| 16 |
4 |
▶ | if (he) SvSETMAGIC(HeVAL(he)); |
Branch: 3 branches
| Branch | True | False | Total |
| if (he) SvSETMAGIC(HeVAL(he)); |
4 |
0 |
4 |
| if (he) SvSETMAGIC(HeVAL(he)); |
4 |
0 |
4 |
| if (he) SvSETMAGIC(HeVAL(he)); |
4 |
0 |
4 |
|
| 17 |
4 |
| } |
| 18 |
|
| |
| 19 |
4 |
| void Scope::Hints::remove (string_view name) { |
| 20 |
4 |
| PL_hints |= HINT_LOCALIZE_HH; |
| 21 |
4 |
▶ | Hash hints = GvHV(PL_hintgv); |
Branch: 1 branch
| Branch | True | False | Total |
| Hash hints = GvHV(PL_hintgv); |
4 |
0 |
4 |
|
| 22 |
4 |
▶ | hints.erase(name); |
Branch: 1 branch
| Branch | True | False | Total |
| hints.erase(name); |
4 |
0 |
4 |
|
| 23 |
4 |
| } |
| 24 |
|
| |
| 25 |
3 |
| Hash Scope::Hints::get () { |
| 26 |
3 |
| return Hash::noinc(cop_hints_2hv(PL_curcop, 0)); |
| 27 |
|
| } |
| 28 |
|
| |
| 29 |
1 |
| Scalar Scope::Hints::get_ct (string_view name) { |
| 30 |
1 |
▶ | Hash hints = GvHV(PL_hintgv); |
Branch: 1 branch
| Branch | True | False | Total |
| Hash hints = GvHV(PL_hintgv); |
1 |
0 |
1 |
|
| 31 |
2 |
▶ | return hints[name]; |
Branch: 1 branch
| Branch | True | False | Total |
| return hints[name]; |
1 |
0 |
1 |
|
| 32 |
1 |
| } |
| 33 |
|
| |
| 34 |
|
| } |