line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
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
|
8
|
50
|
|
|
|
|
auto copy = Sv::create(); |
10
|
4
|
50
|
|
|
|
|
sv_setsv(copy, value); |
11
|
|
|
|
|
|
|
|
12
|
4
|
|
|
|
|
|
auto hv = GvHV(PL_hintgv); |
13
|
4
|
50
|
|
|
|
|
auto he = hv_store_ent(hv, Simple(name), copy.detach(), 0); |
|
|
50
|
|
|
|
|
|
14
|
4
|
|
|
|
|
|
PL_hints |= HINT_LOCALIZE_HH; |
15
|
|
|
|
|
|
|
|
16
|
4
|
50
|
|
|
|
|
if (he) SvSETMAGIC(HeVAL(he)); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
17
|
4
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
4
|
|
|
|
|
|
void Scope::Hints::remove (string_view name) { |
20
|
4
|
|
|
|
|
|
PL_hints |= HINT_LOCALIZE_HH; |
21
|
8
|
50
|
|
|
|
|
Hash hints = GvHV(PL_hintgv); |
22
|
4
|
50
|
|
|
|
|
hints.erase(name); |
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
|
2
|
50
|
|
|
|
|
Hash hints = GvHV(PL_hintgv); |
31
|
2
|
50
|
|
|
|
|
return hints[name]; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
} |