diff options
Diffstat (limited to 'Master/tlpkg/tlperl/lib/JSON/PP.pm')
-rw-r--r-- | Master/tlpkg/tlperl/lib/JSON/PP.pm | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/Master/tlpkg/tlperl/lib/JSON/PP.pm b/Master/tlpkg/tlperl/lib/JSON/PP.pm index cef9f421752..2e617fc6227 100644 --- a/Master/tlpkg/tlperl/lib/JSON/PP.pm +++ b/Master/tlpkg/tlperl/lib/JSON/PP.pm @@ -11,7 +11,7 @@ use Carp (); use B (); #use Devel::Peek; -$JSON::PP::VERSION = '2.27105'; +$JSON::PP::VERSION = '2.27200'; @JSON::PP::EXPORT = qw(encode_json decode_json from_json to_json); @@ -1459,7 +1459,7 @@ sub incr_parse { if ( defined wantarray ) { - $self->{incr_mode} = INCR_M_WS; + $self->{incr_mode} = INCR_M_WS unless defined $self->{incr_mode}; if ( wantarray ) { my @ret; @@ -1470,10 +1470,10 @@ sub incr_parse { push @ret, $self->_incr_parse( $coder, $self->{incr_text} ); unless ( !$self->{incr_nest} and $self->{incr_mode} == INCR_M_JSON ) { - $self->{incr_mode} = INCR_M_WS; + $self->{incr_mode} = INCR_M_WS if $self->{incr_mode} != INCR_M_STR; } - } until ( !$self->{incr_text} ); + } until ( length $self->{incr_text} >= $self->{incr_p} ); $self->{incr_parsing} = 0; @@ -1512,6 +1512,10 @@ sub _incr_parse { my $s = substr( $text, $p++, 1 ); if ( $s eq '"' ) { + if (substr( $text, $p - 2, 1 ) eq '\\' ) { + next; + } + if ( $self->{incr_mode} != INCR_M_STR ) { $self->{incr_mode} = INCR_M_STR; } @@ -1545,6 +1549,7 @@ sub _incr_parse { $self->{incr_p} = $p; + return if ( $self->{incr_mode} == INCR_M_STR and not $self->{incr_nest} ); return if ( $self->{incr_mode} == INCR_M_JSON and $self->{incr_nest} > 0 ); return '' unless ( length substr( $self->{incr_text}, 0, $p ) ); @@ -1625,9 +1630,9 @@ JSON::PP - JSON::XS compatible pure-Perl module. =head1 VERSION - 2.27105 + 2.27200 -L<JSON::XS> 2.27 compatible. +L<JSON::XS> 2.27 (~2.30) compatible. =head1 NOTE @@ -1826,7 +1831,7 @@ Basically, check to L<JSON> or L<JSON::XS>. =head2 new - $json = new JSON::PP + $json = JSON::PP->new Rturns a new JSON::PP object that can be used to de/encode JSON strings. @@ -2804,7 +2809,7 @@ Makamaka Hannyaharamitu, E<lt>makamaka[at]cpan.orgE<gt> =head1 COPYRIGHT AND LICENSE -Copyright 2007-2010 by Makamaka Hannyaharamitu +Copyright 2007-2011 by Makamaka Hannyaharamitu This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. |