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.