Skip Menu |
 

This queue is for tickets about the YAML-Syck CPAN distribution.

Report information
The Basics
Id: 32910
Status: resolved
Priority: 0/
Queue: YAML-Syck

People
Owner: Nobody in particular
Requestors: cho45 [...] lowreal.net
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 1.01
Fixed in: (no value)



Subject: JSON::Syck party violates RFC 4627 (implicit values)
Download (untitled) / with headers
text/plain 177b
JSON not allows single-quoted string literal but some string like bool/null are single-quoted. Ruby's json does not parse this correctly. * http://www.ietf.org/rfc/rfc4627.txt
Subject: json-usedoublequote.t
use strict; use t::TestYAML (); use Test::More tests => 14; use JSON::Syck; { # RFC 4627 only allows double-quoted string. $JSON::Syck::SingleQuote = 0; my $t; $t = JSON::Syck::Dump({ foo => "y" }); like $t, qr/"y"/; $t = JSON::Syck::Dump({ foo => "n" }); like $t, qr/"n"/; $t = JSON::Syck::Dump({ foo => "yes" }); like $t, qr/"yes"/; $t = JSON::Syck::Dump({ foo => "no" }); like $t, qr/"no"/; $t = JSON::Syck::Dump({ foo => "true" }); like $t, qr/"true"/; $t = JSON::Syck::Dump({ foo => "false" }); like $t, qr/"false"/; $t = JSON::Syck::Dump({ foo => "null" }); like $t, qr/"null"/; } { # Violate RFC but needed? $JSON::Syck::SingleQuote = 1; my $t; $t = JSON::Syck::Dump({ foo => "y" }); like $t, qr/'y'/; $t = JSON::Syck::Dump({ foo => "n" }); like $t, qr/'n'/; $t = JSON::Syck::Dump({ foo => "yes" }); like $t, qr/'yes'/; $t = JSON::Syck::Dump({ foo => "no" }); like $t, qr/'no'/; $t = JSON::Syck::Dump({ foo => "true" }); like $t, qr/'true'/; $t = JSON::Syck::Dump({ foo => "false" }); like $t, qr/'false'/; $t = JSON::Syck::Dump({ foo => "null" }); like $t, qr/'null'/; }
Subject: emitter.c.usedoublequote.diff
--- YAML-Syck-1.01.orig/emitter.c 2007-12-12 08:28:02.000000000 +0900 +++ YAML-Syck-1.01/emitter.c 2008-02-04 17:03:17.000000000 +0900 @@ -684,7 +684,7 @@ && (len > 0) ) { - force_style = scalar_1quote; + force_style = (force_style == scalar_2quote) ? scalar_2quote : scalar_1quote; } else { /* complex key -- disabled by Audrey Tang -/ if ( parent->status == syck_lvl_map && parent->ncount % 2 == 1 &&
Thanks, resolved in YAML::Syck 1.03 (JSON::Syck 0.29).


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.