| 1 | package JSON::PP58; | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | 3 | ▶ | use 5.008; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 3 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||
| 6 | 3 | my @properties; | |||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||
| 8 | 3 | $JSON::PP58::VERSION = '1.03'; | |||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||
| 11 | BEGIN { | ||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||
| 13 | 3 | ▶ | unless ( defined &utf8::is_utf8 ) { | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=4 SCAR=17.9
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 14 | 0 | require Encode; | |||||||||||||||||||||||||||
| 15 | 0 | *utf8::is_utf8 = *Encode::is_utf8; | |||||||||||||||||||||||||||
| 16 | } | ||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||
| 18 | 3 | *JSON::PP::JSON_PP_encode_ascii = \&JSON::PP::_encode_ascii; | |||||||||||||||||||||||||||
| 19 | 3 | *JSON::PP::JSON_PP_encode_latin1 = \&JSON::PP::_encode_latin1; | |||||||||||||||||||||||||||
| 20 | 3 | *JSON::PP::JSON_PP_decode_surrogates = \&JSON::PP::_decode_surrogates; | |||||||||||||||||||||||||||
| 21 | 3 | *JSON::PP::JSON_PP_decode_unicode = \&JSON::PP::_decode_unicode; | |||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||
| 23 | 3 | ▶ | if ($] >= 5.008 and $] < 5.008003) { # join() in 5.8.0 - 5.8.2 is broken. | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$] >= "5.008" and $] < "5.008003"
MC/DC0%0/2
$] >= "5.008" and $] < "5.008003"
$] >= "5.008"
$] < "5.008003"
Truth table33%1/3
A and B
A= $] >= "5.008"B= $] < "5.008003"
| |||||||||||||||||||||||||||||
| 24 | package JSON::PP; | ||||||||||||||||||||||||||||
| 25 | 0 | require subs; | |||||||||||||||||||||||||||
| 26 | 0 | subs->import('join'); | |||||||||||||||||||||||||||
| 27 | 0 | eval q| | |||||||||||||||||||||||||||
| 28 | sub join { | ||||||||||||||||||||||||||||
| 29 | return '' if (@_ < 2); | ||||||||||||||||||||||||||||
| 30 | my $j = shift; | ||||||||||||||||||||||||||||
| 31 | my $str = shift; | ||||||||||||||||||||||||||||
| 32 | for (@_) { $str .= $j . $_; } | ||||||||||||||||||||||||||||
| 33 | return $str; | ||||||||||||||||||||||||||||
| 34 | } | ||||||||||||||||||||||||||||
| 35 | |; | ||||||||||||||||||||||||||||
| 36 | } | ||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||
| 38 | } | ||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||
| 41 | sub JSON::PP::incr_parse { | ||||||||||||||||||||||||||||
| 42 | 0 | ▶ | local $Carp::CarpLevel = 1; | ||||||||||||||||||||||||||
|
Subroutine
incr_parse: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||
| 43 | 0 | ▶ | ( $_[0]->{_incr_parser} ||= JSON::PP::IncrParser->new )->incr_parse( @_ ); | ||||||||||||||||||||||||||
|
Condition0%0/3
$_[0]{"_incr_parser"} ||= "JSON::PP::IncrParser"->new
MC/DC0%0/2
$_[0]{"_incr_parser"} ||= "JSON::PP::IncrParser"->new
$_[0]{"_incr_parser"}
"JSON::PP::IncrParser"->new
Truth table0%0/3
A ||= B
A= $_[0]{"_incr_parser"}B= "JSON::PP::IncrParser"->new
| |||||||||||||||||||||||||||||
| 44 | } | ||||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||
| 47 | sub JSON::PP::incr_text : lvalue { | ||||||||||||||||||||||||||||
| 48 | 0 | ▶ | $_[0]->{_incr_parser} ||= JSON::PP::IncrParser->new; | ||||||||||||||||||||||||||
|
Subroutine
incr_text: not called CC=3 SCAR=24.8
Pod
documented
Condition0%0/3
$_[0]{"_incr_parser"} ||= "JSON::PP::IncrParser"->new
MC/DC0%0/2
$_[0]{"_incr_parser"} ||= "JSON::PP::IncrParser"->new
$_[0]{"_incr_parser"}
"JSON::PP::IncrParser"->new
Truth table0%0/3
A ||= B
A= $_[0]{"_incr_parser"}B= "JSON::PP::IncrParser"->new
| |||||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||
| 50 | 0 | ▶ | if ( $_[0]->{_incr_parser}->{incr_parsing} ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 51 | 0 | Carp::croak("incr_text can not be called when the incremental parser already started parsing"); | |||||||||||||||||||||||||||
| 52 | } | ||||||||||||||||||||||||||||
| 53 | 0 | $_[0]->{_incr_parser}->{incr_text}; | |||||||||||||||||||||||||||
| 54 | } | ||||||||||||||||||||||||||||
| 55 | |||||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||
| 57 | sub JSON::PP::incr_skip { | ||||||||||||||||||||||||||||
| 58 | 0 | ▶ | ( $_[0]->{_incr_parser} ||= JSON::PP::IncrParser->new )->incr_skip; | ||||||||||||||||||||||||||
|
Subroutine
incr_skip: not called CC=2 SCAR=17.9
Pod
documented
Condition0%0/3
$_[0]{"_incr_parser"} ||= "JSON::PP::IncrParser"->new
MC/DC0%0/2
$_[0]{"_incr_parser"} ||= "JSON::PP::IncrParser"->new
$_[0]{"_incr_parser"}
"JSON::PP::IncrParser"->new
Truth table0%0/3
A ||= B
A= $_[0]{"_incr_parser"}B= "JSON::PP::IncrParser"->new
| |||||||||||||||||||||||||||||
| 59 | } | ||||||||||||||||||||||||||||
| 60 | |||||||||||||||||||||||||||||
| 61 | |||||||||||||||||||||||||||||
| 62 | sub JSON::PP::incr_reset { | ||||||||||||||||||||||||||||
| 63 | 0 | ▶ | ( $_[0]->{_incr_parser} ||= JSON::PP::IncrParser->new )->incr_reset; | ||||||||||||||||||||||||||
|
Subroutine
incr_reset: not called CC=2 SCAR=17.9
Pod
documented
Condition0%0/3
$_[0]{"_incr_parser"} ||= "JSON::PP::IncrParser"->new
MC/DC0%0/2
$_[0]{"_incr_parser"} ||= "JSON::PP::IncrParser"->new
$_[0]{"_incr_parser"}
"JSON::PP::IncrParser"->new
Truth table0%0/3
A ||= B
A= $_[0]{"_incr_parser"}B= "JSON::PP::IncrParser"->new
| |||||||||||||||||||||||||||||
| 64 | } | ||||||||||||||||||||||||||||
| 65 | |||||||||||||||||||||||||||||
| 66 | |||||||||||||||||||||||||||||
| 67 | 3 | 1; | |||||||||||||||||||||||||||
| 68 | __END__ | ||||||||||||||||||||||||||||