line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
############################################################################### |
2
|
|
|
|
|
|
|
# The receiver class can reshape the data at any given rule match. |
3
|
|
|
|
|
|
|
############################################################################### |
4
|
|
|
|
|
|
|
package JSONY::Receiver; |
5
|
3
|
|
|
3
|
|
24
|
use base 'Pegex::Tree'; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
1360
|
|
6
|
3
|
|
|
3
|
|
12770
|
use boolean; |
|
3
|
|
|
|
|
8186
|
|
|
3
|
|
|
|
|
13
|
|
7
|
|
|
|
|
|
|
|
8
|
2
|
50
|
|
2
|
1
|
285
|
sub final { ref $_[1] ? $_[1] : [$_[1]] } |
9
|
31
|
|
|
31
|
0
|
40300
|
sub got_top_seq_entry { $_[1][0][0] } |
10
|
0
|
|
|
0
|
0
|
0
|
sub got_top_map { $_[0]->got_map([$_[1]]) } |
11
|
1
|
|
|
1
|
0
|
613
|
sub got_seq { $_[1]->[0] } |
12
|
0
|
|
|
0
|
0
|
0
|
sub got_map { +{ map {($_->[0], $_->[1])} @{$_[1]->[0]} } } |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
13
|
0
|
|
|
0
|
0
|
0
|
sub got_string {"$_[1]"} |
14
|
|
|
|
|
|
|
sub got_bare { |
15
|
35
|
|
|
35
|
0
|
21415
|
(undef, $_) = @_; |
16
|
35
|
100
|
|
|
|
282
|
/^true$/ ? true : |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
17
|
|
|
|
|
|
|
/^false$/ ? false : |
18
|
|
|
|
|
|
|
/^null$/ ? undef : |
19
|
|
|
|
|
|
|
/^( |
20
|
|
|
|
|
|
|
-? |
21
|
|
|
|
|
|
|
(?: 0 | [1-9] [0-9]* ) |
22
|
|
|
|
|
|
|
(?: \. [0-9]* )? |
23
|
|
|
|
|
|
|
(?: [eE] [\-\+]? [0-9]+ )? |
24
|
|
|
|
|
|
|
)$/x ? ($_ + 0) : |
25
|
|
|
|
|
|
|
"$_" |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
sub got_list { |
28
|
1
|
|
|
1
|
0
|
515
|
(undef, $_) = @_; |
29
|
1
|
50
|
|
|
|
6
|
@$_ == 1 ? $_->[0] : $_; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
1; |