r75139 - in /branches/upstream/libjson-pp-perl/current: Changes MANIFEST META.yml README lib/JSON/PP.pm t/116_incr_parse_fixed.t

ghedo-guest at users.alioth.debian.org ghedo-guest at users.alioth.debian.org
Sun Jun 5 13:07:24 UTC 2011


Author: ghedo-guest
Date: Sun Jun  5 13:07:16 2011
New Revision: 75139

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=75139
Log:
[svn-upgrade] new version libjson-pp-perl (2.27200)

Added:
    branches/upstream/libjson-pp-perl/current/t/116_incr_parse_fixed.t
Modified:
    branches/upstream/libjson-pp-perl/current/Changes
    branches/upstream/libjson-pp-perl/current/MANIFEST
    branches/upstream/libjson-pp-perl/current/META.yml
    branches/upstream/libjson-pp-perl/current/README
    branches/upstream/libjson-pp-perl/current/lib/JSON/PP.pm

Modified: branches/upstream/libjson-pp-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libjson-pp-perl/current/Changes?rev=75139&op=diff
==============================================================================
--- branches/upstream/libjson-pp-perl/current/Changes (original)
+++ branches/upstream/libjson-pp-perl/current/Changes Sun Jun  5 13:07:16 2011
@@ -20,9 +20,14 @@
 
     * release JSON distribution as stable version.
 
-    * rename JSON::PPdev into JSON::PP and release on CPAN. <<<< HERE
+    * rename JSON::PPdev into JSON::PP and release on CPAN.
+
+    * Perl 5.14.0 released. This module is a dual-life module. <<<< HERE
 
 --------------------------------------------------------------------------
+
+2.27200  Sun May 22 12:17:51 2011
+	- fixed incr_parse docodeing string more correctly (rt#68032 by LCONS)
 
 2.27105  Tue Mar  8 12:38:42 2011
 	- removed t/900_pod.t from package because of author test

Modified: branches/upstream/libjson-pp-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libjson-pp-perl/current/MANIFEST?rev=75139&op=diff
==============================================================================
--- branches/upstream/libjson-pp-perl/current/MANIFEST (original)
+++ branches/upstream/libjson-pp-perl/current/MANIFEST Sun Jun  5 13:07:16 2011
@@ -39,4 +39,5 @@
 t/113_overloaded_eq.t
 t/114_decode_prefix.t
 t/115_tie_ixhash.t
+t/116_incr_parse_fixed.t
 t/_unicode_handling.pm

Modified: branches/upstream/libjson-pp-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libjson-pp-perl/current/META.yml?rev=75139&op=diff
==============================================================================
--- branches/upstream/libjson-pp-perl/current/META.yml (original)
+++ branches/upstream/libjson-pp-perl/current/META.yml Sun Jun  5 13:07:16 2011
@@ -1,6 +1,6 @@
 --- #YAML:1.0
 name:               JSON-PP
-version:            2.27105
+version:            2.27200
 abstract:           JSON::XS compatible pure-Perl module.
 author:
     - Makamaka Hannyaharamitu, E<lt>makamaka[at]cpan.orgE<gt>

Modified: branches/upstream/libjson-pp-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libjson-pp-perl/current/README?rev=75139&op=diff
==============================================================================
--- branches/upstream/libjson-pp-perl/current/README (original)
+++ branches/upstream/libjson-pp-perl/current/README Sun Jun  5 13:07:16 2011
@@ -24,6 +24,8 @@
 
     * rename JSON::PPdev into JSON::PP and release on CPAN.
 
+    * Perl 5.14.0 released. This module is a dual-life module. <<<< HERE
+
 =================
 
 INSTALLATION

Modified: branches/upstream/libjson-pp-perl/current/lib/JSON/PP.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libjson-pp-perl/current/lib/JSON/PP.pm?rev=75139&op=diff
==============================================================================
--- branches/upstream/libjson-pp-perl/current/lib/JSON/PP.pm (original)
+++ branches/upstream/libjson-pp-perl/current/lib/JSON/PP.pm Sun Jun  5 13:07:16 2011
@@ -11,7 +11,7 @@
 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 @@
 
     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 @@
                 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 @@
         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 @@
 
     $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 @@
 
 =head1 VERSION
 
-    2.27105
-
-L<JSON::XS> 2.27 compatible.
+    2.27200
+
+L<JSON::XS> 2.27 (~2.30) compatible.
 
 =head1 NOTE
 
@@ -1826,7 +1831,7 @@
 
 =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 @@
 
 =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. 

Added: branches/upstream/libjson-pp-perl/current/t/116_incr_parse_fixed.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libjson-pp-perl/current/t/116_incr_parse_fixed.t?rev=75139&op=file
==============================================================================
--- branches/upstream/libjson-pp-perl/current/t/116_incr_parse_fixed.t (added)
+++ branches/upstream/libjson-pp-perl/current/t/116_incr_parse_fixed.t Sun Jun  5 13:07:16 2011
@@ -1,0 +1,25 @@
+#!/usr/bin/perl
+
+use strict;
+use Test::More tests => 4;
+
+use JSON::PP;
+
+my $json = JSON::PP->new->allow_nonref();
+
+my @vs = $json->incr_parse('"a\"bc');
+
+ok( not scalar(@vs) );
+
+ at vs = $json->incr_parse('"');
+
+is( $vs[0], "a\"bc" );
+
+
+$json = JSON::PP->new;
+
+ at vs = $json->incr_parse('"a\"bc');
+ok( not scalar(@vs) );
+ at vs = eval { $json->incr_parse('"') };
+ok($@ =~ qr/JSON text must be an object or array/);
+




More information about the Pkg-perl-cvs-commits mailing list