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
|
|
22
|
use base 'Pegex::Tree'; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
1308
|
|
6
|
3
|
|
|
3
|
|
12250
|
use boolean; |
|
3
|
|
|
|
|
7726
|
|
|
3
|
|
|
|
|
13
|
|
7
|
|
|
|
|
|
|
|
8
|
30
|
|
|
30
|
0
|
38494
|
sub got_top_seq_entry { $_[1][0][0] } |
9
|
0
|
|
|
0
|
0
|
0
|
sub got_top_map { $_[0]->got_map([$_[1]]) } |
10
|
1
|
|
|
1
|
0
|
652
|
sub got_seq { $_[1]->[0] } |
11
|
0
|
|
|
0
|
0
|
0
|
sub got_map { +{ map {($_->[0], $_->[1])} @{$_[1]->[0]} } } |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
12
|
0
|
|
|
0
|
0
|
0
|
sub got_string {"$_[1]"} |
13
|
|
|
|
|
|
|
sub got_bare { |
14
|
34
|
|
|
34
|
0
|
20635
|
(undef, $_) = @_; |
15
|
34
|
100
|
|
|
|
288
|
/^true$/ ? true : |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
16
|
|
|
|
|
|
|
/^false$/ ? false : |
17
|
|
|
|
|
|
|
/^null$/ ? undef : |
18
|
|
|
|
|
|
|
/^( |
19
|
|
|
|
|
|
|
-? |
20
|
|
|
|
|
|
|
(?: 0 | [1-9] [0-9]* ) |
21
|
|
|
|
|
|
|
(?: \. [0-9]* )? |
22
|
|
|
|
|
|
|
(?: [eE] [\-\+]? [0-9]+ )? |
23
|
|
|
|
|
|
|
)$/x ? ($_ + 0) : |
24
|
|
|
|
|
|
|
"$_" |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
sub got_list { |
27
|
1
|
|
|
1
|
0
|
574
|
(undef, $_) = @_; |
28
|
1
|
50
|
|
|
|
6
|
@$_ == 1 ? $_->[0] : $_; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
1; |