Skip Menu |
 

This queue is for tickets about the JSON-YAJL CPAN distribution.

Report information
The Basics
Id: 90125
Status: open
Priority: 0/
Queue: JSON-YAJL

People
Owner: Nobody in particular
Requestors: dada [...] perl.it
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.10
Fixed in: (no value)



Subject: Doesn't recognize empty strings
Download (untitled) / with headers
text/plain 863b
Looks like empty strings ("") are not recognized properly, and JSON::YAJL swallows the rest of the file (or block). Example script: use strict; use warnings; use feature 'say'; use JSON::YAJL; my $parser = JSON::YAJL::Parser->new( 0, 0, [ sub { say "null" }, sub { say "bool: @_" }, undef, undef, sub { say "number: @_" }, sub { say "string: @_" }, sub { say "map_open" }, sub { say "map_key: @_" }, sub { say "map_close" }, sub { say "array_open" }, sub { say "array_close" }, ] ); while(<DATA>) { $parser->parse($_); } $parser->parse_complete(); __DATA__ { "foo": "", "bar": "baz" } Output: map_open map_key: foo string: ", "bar": "baz" } map_key: bar string: baz map_close cheers, Aldo
Download (untitled) / with headers
text/plain 319b
On Thu Nov 07 11:31:30 2013, ACALPINI wrote: Show quoted text
> Looks like empty strings ("") are not recognized properly, and > JSON::YAJL swallows the rest of the file (or block).
This is bug in Parser.xs, not in the underlying yajl library. For the fix see my pull request https://github.com/acme/JSON--YAJL/pull/3 -- Reini Urban


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.