| 1 | package JSON::SL::Boolean; | ||||||||||
| 2 | |||||||||||
| 3 | use overload | ||||||||||
| 4 | 4 | ▶ | "0+" => sub { ${$_[0]} }, | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.8
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 0 | ▶ | "++" => sub { $_[0] = ${$_[0]} + 1 }, | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||
| 6 | 0 | ▶ | "--" => sub { $_[0] = ${$_[0]} - 1 }, | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||
| 7 | 19 | fallback => 1; | |||||||||
| 8 | 19 | 1; | |||||||||
| 9 | |||||||||||
| 10 | |||||||||||
| 11 | package JSON::SL; | ||||||||||
| 12 | 19 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 13 | 19 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 14 | 19 | our $VERSION; | |||||||||
| 15 | 19 | ▶ | use base qw(Exporter); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 16 | 19 | our @EXPORT_OK = qw(decode_json unescape_json_string); | |||||||||
| 17 | |||||||||||
| 18 | 19 | ▶ | BEGIN { | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 19 | 19 | $VERSION = '1.0.7'; | |||||||||
| 20 | 19 | require XSLoader; | |||||||||
| 21 | 19 | XSLoader::load(__PACKAGE__, $VERSION); | |||||||||
| 22 | } | ||||||||||
| 23 | |||||||||||
| 24 | 0 | ▶ | sub CLONE_SKIP { | ||||||||
|
Subroutine
CLONE_SKIP: not called CC=1 SCAR=6.9
| |||||||||||
| 25 | 0 | return 1; | |||||||||
| 26 | } | ||||||||||
| 27 | |||||||||||
| 28 | 2 | ▶ | sub unescape_settings { | ||||||||
|
Subroutine
unescape_settings: called CC=3 SCAR=14.2
Pod
undocumented
| |||||||||||
| 29 | 2 | my ($self,$c) = @_; | |||||||||
| 30 | 2 | ▶ | if (!defined $c) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 31 | 0 | require JSON::SL::EscapeTH; | |||||||||
| 32 | 0 | my $ret = {}; | |||||||||
| 33 | 0 | tie(%$ret, 'JSON::SL::EscapeTH', $self); | |||||||||
| 34 | 0 | return $ret; | |||||||||
| 35 | } else { | ||||||||||
| 36 | 2 | $c = ord($c); | |||||||||
| 37 | 2 | ▶ | if (@_ == 3) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 38 | 2 | return $self->_escape_table_chr($c, $_[2]); | |||||||||
| 39 | } else { | ||||||||||
| 40 | 0 | return $self->_escape_table_chr($c); | |||||||||
| 41 | } | ||||||||||
| 42 | } | ||||||||||
| 43 | } | ||||||||||
| 44 | |||||||||||
| 45 | 19 | 1; | |||||||||
| 46 | |||||||||||
| 47 | __END__ | ||||||||||