line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
1
|
|
|
1
|
|
127173
|
use strict; |
|
1
|
|
|
|
|
9
|
|
|
1
|
|
|
|
|
31
|
|
3
|
1
|
|
|
1
|
|
4
|
use warnings FATAL => 'all'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
38
|
|
4
|
1
|
|
|
1
|
|
6
|
use feature 'state'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
132
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
package MarpaX::ESLIF::ECMA404; |
7
|
1
|
|
|
1
|
|
399
|
use Log::Any qw/$log/; |
|
1
|
|
|
|
|
7121
|
|
|
1
|
|
|
|
|
6
|
|
8
|
1
|
|
|
1
|
|
2283
|
use MarpaX::ESLIF 3.0.32; |
|
1
|
|
|
|
|
133246
|
|
|
1
|
|
|
|
|
213
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
my $ESLIF = MarpaX::ESLIF->new($log); |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
# ABSTRACT: JSON Data Interchange Format following ECMA-404 specification |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
our $VERSION = '0.014'; # VERSION |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:JDDPAUSE'; # AUTHORITY |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub decode { |
21
|
354
|
|
|
354
|
1
|
3147116
|
my ($self, $input, %options) = @_; |
22
|
|
|
|
|
|
|
|
23
|
354
|
50
|
|
|
|
1261
|
return $options{strict} ? _JSONStrict()->decode($input, %options) : _JSONRelaxed()->decode($input, %options) |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub encode { |
28
|
0
|
|
|
0
|
1
|
0
|
my ($self, $input, %options) = @_; |
29
|
|
|
|
|
|
|
|
30
|
0
|
0
|
|
|
|
0
|
return $options{strict} ? _JSONStrict()->encode($input, %options) : _JSONRelaxed()->encode($input, %options) |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
# ------------- |
34
|
|
|
|
|
|
|
# Private stubs |
35
|
|
|
|
|
|
|
# ------------- |
36
|
|
|
|
|
|
|
sub _JSONStrict { |
37
|
354
|
|
|
354
|
|
653
|
state $JSONStrict = MarpaX::ESLIF::JSON->new($ESLIF, 1); |
38
|
|
|
|
|
|
|
|
39
|
354
|
|
|
|
|
37087
|
return $JSONStrict |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub _JSONRelaxed { |
43
|
0
|
|
|
0
|
|
|
state $JSONRelaxed = MarpaX::ESLIF::JSON->new($ESLIF, 0); |
44
|
|
|
|
|
|
|
|
45
|
0
|
|
|
|
|
|
return $JSONRelaxed |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
1; |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
__END__ |