| 1 | package JSON::Pointer::Context; | ||||||||||
| 2 | |||||||||||
| 3 | 16 | ▶ | use 5.008_001; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 16 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 16 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | use Class::Accessor::Lite ( | ||||||||||
| 7 | 16 | 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 | 16 | ▶ | ); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 21 | |||||||||||
| 22 | 16 | our $VERSION = "0.06"; | |||||||||
| 23 | |||||||||||
| 24 | sub new { | ||||||||||
| 25 | 144 | ▶ | my $class = shift; | ||||||||
|
Subroutine
new: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||
| 26 | 144 | ▶ | my $args = ref $_[0] ? $_[0] : +{ @_ }; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 27 | 144 | %$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 | 144 | bless $args => $class; | |||||||||
| 38 | } | ||||||||||
| 39 | |||||||||||
| 40 | sub begin { | ||||||||||
| 41 | 182 | ▶ | my ($self, $token) = @_; | ||||||||
|
Subroutine
begin: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 42 | 182 | $self->{last_token} = $token; | |||||||||
| 43 | ### assign before target into parent | ||||||||||
| 44 | 182 | $self->{parent} = $self->{target}; | |||||||||
| 45 | } | ||||||||||
| 46 | |||||||||||
| 47 | sub next { | ||||||||||
| 48 | 146 | ▶ | my ($self, $target) = @_; | ||||||||
|
Subroutine
next: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 49 | 146 | $self->{target} = $target; | |||||||||
| 50 | 146 | push(@{$self->{processed_tokens}}, $self->{last_token}); | |||||||||
| 51 | } | ||||||||||
| 52 | |||||||||||
| 53 | 16 | 1; | |||||||||
| 54 | |||||||||||
| 55 | __END__ | ||||||||||