In perl.git, the branch blead has been updated <https://perl5.git.perl.org/perl.git/commitdiff/929e53be972b0c811eca54a3c7017db116f62e4a?hp=678ae29284d351e19c3401c94ccf83538266b096>
- Log ----------------------------------------------------------------- commit 929e53be972b0c811eca54a3c7017db116f62e4a Author: David Mitchell <[email protected]> Date: Sat Feb 23 12:27:17 2019 +0000 upgrade cpan/JSON-PP from 4.00 to 4.02 4.02 2019-02-23 - fix a test that breaks if perl is compiled with -Dquadmath (RT-128589) 4.01 2019-02-22 - allow to pass indent_length to json_pp (GH#46) ----------------------------------------------------------------------- Summary of changes: META.json | 2 +- Porting/Maintainers.pl | 2 +- cpan/JSON-PP/bin/json_pp | 20 +++++++++++++++----- cpan/JSON-PP/lib/JSON/PP.pm | 4 ++-- cpan/JSON-PP/t/011_pc_expo.t | 2 +- 5 files changed, 20 insertions(+), 10 deletions(-) diff --git a/META.json b/META.json index 5216ba9a07..cacbc8acd0 100644 --- a/META.json +++ b/META.json @@ -128,5 +128,5 @@ } }, "version" : "5.029009", - "x_serialization_backend" : "JSON::PP version 4.00" + "x_serialization_backend" : "JSON::PP version 4.02" } diff --git a/Porting/Maintainers.pl b/Porting/Maintainers.pl index 5775b11347..1bff10bda7 100755 --- a/Porting/Maintainers.pl +++ b/Porting/Maintainers.pl @@ -651,7 +651,7 @@ use File::Glob qw(:case); }, 'JSON::PP' => { - 'DISTRIBUTION' => 'ISHIGAKI/JSON-PP-4.00.tar.gz', + 'DISTRIBUTION' => 'ISHIGAKI/JSON-PP-4.02.tar.gz', 'FILES' => q[cpan/JSON-PP], }, diff --git a/cpan/JSON-PP/bin/json_pp b/cpan/JSON-PP/bin/json_pp index 6221315399..5f956b1fc3 100644 --- a/cpan/JSON-PP/bin/json_pp +++ b/cpan/JSON-PP/bin/json_pp @@ -10,7 +10,7 @@ use JSON::PP (); my %allow_json_opt = map { $_ => 1 } qw( ascii latin1 utf8 pretty indent space_before space_after relaxed canonical allow_nonref - allow_singlequote allow_barekey allow_bignum loose escape_slash + allow_singlequote allow_barekey allow_bignum loose escape_slash indent_length ); @@ -31,12 +31,20 @@ if ( $version ) { $json_opt = '' if $json_opt eq '-'; -my @json_opt = grep { $allow_json_opt{ $_ } or die "'$_' is not a valid json option" } split/,/, $json_opt; +my %json_opt; +for my $opt (split /,/, $json_opt) { + my ($key, $value) = split /=/, $opt, 2; + $value = 1 unless defined $value; + die "'$_' is not a valid json option" unless $allow_json_opt{$key}; + $json_opt{$key} = $value; +} my %F = ( 'json' => sub { my $json = JSON::PP->new; - $json->$_() for @json_opt; + for my $key (keys %json_opt) { + $json->$key($json_opt{$key}); + } $json->decode( $_ ); }, 'eval' => sub { @@ -51,8 +59,10 @@ my %T = ( 'null' => sub { "" }, 'json' => sub { my $json = JSON::PP->new->utf8; - $json->$_() for @json_opt; - $json->canonical if grep {$_ eq 'pretty'} @json_opt; + for my $key (keys %json_opt) { + $json->$key($json_opt{$key}); + } + $json->canonical if $json_opt{pretty}; $json->encode( $_ ); }, 'dumper' => sub { diff --git a/cpan/JSON-PP/lib/JSON/PP.pm b/cpan/JSON-PP/lib/JSON/PP.pm index 6adb57f5bd..d8b7ab3065 100644 --- a/cpan/JSON-PP/lib/JSON/PP.pm +++ b/cpan/JSON-PP/lib/JSON/PP.pm @@ -14,7 +14,7 @@ use JSON::PP::Boolean; use Carp (); #use Devel::Peek; -$JSON::PP::VERSION = '4.00'; +$JSON::PP::VERSION = '4.02'; @JSON::PP::EXPORT = qw(encode_json decode_json from_json to_json); @@ -1773,7 +1773,7 @@ JSON::PP - JSON::XS compatible pure-Perl module. =head1 VERSION - 4.00 + 4.02 =head1 DESCRIPTION diff --git a/cpan/JSON-PP/t/011_pc_expo.t b/cpan/JSON-PP/t/011_pc_expo.t index 42fe328ede..3167ef977c 100644 --- a/cpan/JSON-PP/t/011_pc_expo.t +++ b/cpan/JSON-PP/t/011_pc_expo.t @@ -37,7 +37,7 @@ $js = q|[1.01e+30]|; $obj = $pc->decode($js); is($obj->[0], 1.01e+30, 'digit 1.01e+30'); $js = $pc->encode($obj); -like($js,qr/\[1.01[Ee]\+0?30\]/, 'digit 1.01e+30'); +like($js,qr/\[(?:1.01[Ee]\+0?30|1010000000000000000000000000000)]/, 'digit 1.01e+30'); # RT-128589 (-Duselongdouble or -Dquadmath) my $vax_float = (pack("d",1) =~ /^[\x80\x10]\x40/); -- Perl5 Master Repository
