Pointer/Context.pm

filter: Statementstmt 100% 24 / 24 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 7 / 7 Podpod 100% 3 / 3 totaltotal 100% 36 / 36 CC 2 SCAR 2.2
CC
2
Cov
100%
new
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.2
« Pointer/Syntax.pm ↑ Summary Pointer/Exception.pm »
1 package JSON::Pointer::Context;
2  
3 17 ▶use 5.008_001;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 17 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 17 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 17 ▶use Class::Accessor::Lite (
Subroutine BEGIN: called CC=1 SCAR=0.0
7 17 new => 0,
8 rw => [
9 qw/
10 pointer
11 tokens
12 processed_tokens
13 last_token
14 last_error
15 result
16 target
17 parent
18 /
19 ],
20 17 );
21  
22 17 our $VERSION = "0.07";
23  
24 162 ▶sub new {
Subroutine new: called CC=2 SCAR=6.9
Pod documented
25 162 my $class = shift;
26 162 ▶ my $args = ref $_[0] ? $_[0] : +{ @_ };
Branch: 1 branch
BranchTrueFalseTotal
ref $_[0] ? : 159 3 162
27 162 %$args = (
28 tokens => [],
29 processed_tokens => [],
30 last_token => undef,
31 last_error => undef,
32 result => 0,
33 target => undef,
34 parent => undef,
35 %$args,
36 );
37 162 bless $args => $class;
38 }
39  
40 197 ▶sub begin {
Subroutine begin: called CC=1 SCAR=0.0
Pod documented
41 197 my ($self, $token) = @_;
42 197 $self->{last_token} = $token;
43 ### assign before target into parent
44 197 $self->{parent} = $self->{target};
45 }
46  
47 161 ▶sub next {
Subroutine next: called CC=1 SCAR=0.0
Pod documented
48 161 my ($self, $target) = @_;
49 161 $self->{target} = $target;
50 161 push(@{$self->{processed_tokens}}, $self->{last_token});
51 }
52  
53 17 1;
54  
55 __END__
« Pointer/Syntax.pm ↑ Summary Pointer/Exception.pm »