line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package JSON::Pointer::Exception; |
2
|
|
|
|
|
|
|
|
3
|
16
|
|
|
16
|
|
390
|
use 5.008_001; |
|
16
|
|
|
|
|
49
|
|
|
16
|
|
|
|
|
600
|
|
4
|
16
|
|
|
16
|
|
81
|
use strict; |
|
16
|
|
|
|
|
24
|
|
|
16
|
|
|
|
|
449
|
|
5
|
16
|
|
|
16
|
|
78
|
use warnings; |
|
16
|
|
|
|
|
28
|
|
|
16
|
|
|
|
|
503
|
|
6
|
|
|
|
|
|
|
use overload ( |
7
|
16
|
|
|
|
|
122
|
q|""| => "to_string" |
8
|
16
|
|
|
16
|
|
8757
|
); |
|
16
|
|
|
|
|
5671
|
|
9
|
|
|
|
|
|
|
|
10
|
16
|
|
|
16
|
|
1190
|
use Carp (); |
|
16
|
|
|
|
|
31
|
|
|
16
|
|
|
|
|
323
|
|
11
|
16
|
|
|
16
|
|
79
|
use Exporter qw(import); |
|
16
|
|
|
|
|
24
|
|
|
16
|
|
|
|
|
5618
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
our $VERSION = '0.06'; |
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
|
65
|
sub ERROR_INVALID_POINTER_SYNTAX { 1; } |
24
|
74
|
|
|
74
|
1
|
14858
|
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
|
12
|
|
|
12
|
1
|
40
|
my ($class, %opts) = @_; |
35
|
12
|
|
|
|
|
54
|
$opts{context}->last_error($opts{code}); |
36
|
12
|
|
|
|
|
301
|
bless { |
37
|
|
|
|
|
|
|
code => $opts{code}, |
38
|
|
|
|
|
|
|
context => $opts{context}, |
39
|
|
|
|
|
|
|
} => $class |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub throw { |
43
|
12
|
|
|
12
|
1
|
42
|
Carp::croak(shift->new(@_)); |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
sub code { |
47
|
6
|
|
|
6
|
1
|
37
|
shift->{code}; |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
sub context { |
51
|
6
|
|
|
6
|
1
|
1260
|
shift->{context}; |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
sub to_string { |
55
|
15
|
|
|
15
|
1
|
656
|
my $self = shift; |
56
|
15
|
|
|
|
|
121
|
sprintf($MESSAGE_BUNDLES{$self->{code}}, $self->{context}{pointer}); |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
1; |
60
|
|
|
|
|
|
|
__END__ |