line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package JSON::Pointer::Exception; |
2
|
|
|
|
|
|
|
|
3
|
16
|
|
|
16
|
|
11313
|
use 5.008_001; |
|
16
|
|
|
|
|
56
|
|
|
16
|
|
|
|
|
911
|
|
4
|
16
|
|
|
16
|
|
85
|
use strict; |
|
16
|
|
|
|
|
32
|
|
|
16
|
|
|
|
|
748
|
|
5
|
16
|
|
|
16
|
|
84
|
use warnings; |
|
16
|
|
|
|
|
31
|
|
|
16
|
|
|
|
|
636
|
|
6
|
|
|
|
|
|
|
use overload ( |
7
|
16
|
|
|
|
|
156
|
q|""| => "to_string" |
8
|
16
|
|
|
16
|
|
14510
|
); |
|
16
|
|
|
|
|
5923
|
|
9
|
|
|
|
|
|
|
|
10
|
16
|
|
|
16
|
|
1396
|
use Carp (); |
|
16
|
|
|
|
|
30
|
|
|
16
|
|
|
|
|
345
|
|
11
|
16
|
|
|
16
|
|
88
|
use Exporter qw(import); |
|
16
|
|
|
|
|
34
|
|
|
16
|
|
|
|
|
6643
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
our $VERSION = '0.04'; |
14
|
|
|
|
|
|
|
our @EXPORT_OK = qw( |
15
|
|
|
|
|
|
|
ERROR_INVALID_POINTER_SYNTAX |
16
|
|
|
|
|
|
|
ERROR_POINTER_REFERENCES_NON_EXISTENT_VALUE |
17
|
|
|
|
|
|
|
); |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
our %EXPORT_TAGS = ( |
20
|
|
|
|
|
|
|
all => [ @EXPORT_OK ], |
21
|
|
|
|
|
|
|
); |
22
|
|
|
|
|
|
|
|
23
|
19
|
|
|
19
|
1
|
242
|
sub ERROR_INVALID_POINTER_SYNTAX { 1; } |
24
|
72
|
|
|
72
|
1
|
18107
|
sub ERROR_POINTER_REFERENCES_NON_EXISTENT_VALUE { 2; } |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
our %MESSAGE_BUNDLES = ( |
27
|
|
|
|
|
|
|
ERROR_INVALID_POINTER_SYNTAX() |
28
|
|
|
|
|
|
|
=> "Invalid pointer syntax (pointer: %s)", |
29
|
|
|
|
|
|
|
ERROR_POINTER_REFERENCES_NON_EXISTENT_VALUE() |
30
|
|
|
|
|
|
|
=> "A pointer that references a non-existent value (pointer: %s)", |
31
|
|
|
|
|
|
|
); |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub new { |
34
|
11
|
|
|
11
|
1
|
41
|
my ($class, %opts) = @_; |
35
|
11
|
|
|
|
|
48
|
$opts{context}->last_error($opts{code}); |
36
|
11
|
|
|
|
|
302
|
bless { |
37
|
|
|
|
|
|
|
code => $opts{code}, |
38
|
|
|
|
|
|
|
context => $opts{context}, |
39
|
|
|
|
|
|
|
} => $class |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub throw { |
43
|
11
|
|
|
11
|
1
|
43
|
Carp::croak(shift->new(@_)); |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
sub code { |
47
|
5
|
|
|
5
|
1
|
34
|
shift->{code}; |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
sub context { |
51
|
6
|
|
|
6
|
1
|
1435
|
shift->{context}; |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
sub to_string { |
55
|
14
|
|
|
14
|
1
|
34000
|
my $self = shift; |
56
|
14
|
|
|
|
|
130
|
sprintf($MESSAGE_BUNDLES{$self->{code}}, $self->{context}{pointer}); |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
1; |
60
|
|
|
|
|
|
|
__END__ |