Skip Menu |

This queue is for tickets about the JSON CPAN distribution.

Report information
The Basics
Id: 52842
Status: resolved
Priority: 0/
Queue: JSON

People
Owner: Nobody in particular
Requestors: IKEGAMI [...] cpan.org
Cc:
AdminCc:

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



Shell-style comments aren't treated as whitespace under a very specific set of circumstances, as shown by the following code: $ PERL_JSON_BACKEND=JSON::PP perl -MJSON -le' my $coder = JSON->new->relaxed->allow_barekey; $coder->incr_parse(q! { # foo foo: "foo" } !); print scalar $coder->incr_parse(); ' HASH(0xa0091d0) $ PERL_JSON_BACKEND=JSON::XS perl -MJSON=-support_by_pp -le' my $coder = JSON->new->relaxed->allow_barekey; $coder->incr_parse(q! { # foo foo: "foo" } !); print scalar $coder->incr_parse(); ' HASH(0xa0091d0) '"' expected, at character offset 33 (before "foo: "foo"n }n ...") at -e line 9. $ PERL_JSON_BACKEND=JSON::XS perl -MJSON=-support_by_pp -le' print JSON->new->relaxed->allow_barekey->decode(q! { # foo foo: "foo" } !); ' HASH(0x8b824e8) I hope to have a patch in the next 24 hours.
On Wed Dec 16 16:28:09 2009, ikegami wrote: Show quoted text
> $ PERL_JSON_BACKEND=JSON::XS perl -MJSON=-support_by_pp -le' > my $coder = JSON->new->relaxed->allow_barekey; > $coder->incr_parse(q! > { > # foo > foo: "foo" > } > !); > print scalar $coder->incr_parse(); > ' > HASH(0xa0091d0) > '"' expected, at character offset 33 (before "foo: "foo"n }n ...") > at -e line 9.
Copy and paste error. That "HASH(0xa0091d0)" shouldn't be there.
resloved in version 2.17