[#41916] Proposal: Bitmap Marking GC — Narihiro Nakamura <authornari@...>

Hi.

18 messages 2012/01/05

[#41941] [ruby-trunk - Bug #5851][Open] make check fails when compiling with GCC 4.7 - *** longjmp causes uninitialized stack frame *** — Vit Ondruch <v.ondruch@...>

12 messages 2012/01/06

[#41979] [ruby-trunk - Bug #5865][Open] Exception#== should return false if the classes differ — Hiro Asari <asari.ruby@...>

10 messages 2012/01/08

[#42003] [ruby-trunk - Bug #5871][Open] regexp \W matches some word characters when inside a case-insensitive character class — Gareth Adams <gareth@...>

14 messages 2012/01/09

[#42016] [ruby-trunk - Feature #5873][Open] Adopt FFI over DL — Heesob Park <phasis@...>

15 messages 2012/01/10

[#42149] [ruby-trunk - Feature #5899][Open] chaining comparsions. — Ondrej Bilka <neleai@...>

12 messages 2012/01/16

[#42164] [ruby-trunk - Feature #5903][Open] Optimize st_table (take 2) — Yura Sokolov <funny.falcon@...>

18 messages 2012/01/17

[ruby-core:42184] Re: YAML flow-collection: is "," a valid separator, or only ", " or " ," ?

From: Aaron Patterson <tenderlove@...>
Date: 2012-01-19 18:54:48 UTC
List: ruby-core #42184
On Fri, Jan 20, 2012 at 01:47:24AM +0900, j.wuttke wrote:
> From my understanding of the YAML spec, rule 138,
> "[0,1,2]" should be a valid array; but under both
> Ruby1.8 and Ruby1.9.3 it is parsed as [0]; to obtain
> [0,1,2] I need to write "[0, 1, 2]".

This appears to be a bug in Syck.  If you install libyaml and recompile
1.9.3, your yaml back end should be Psych.  Psych handles this case
correctly.

With trunk ruby (though 1.9.3 should work if you have libyaml
installed):

    irb(main):001:0> RUBY_VERSION
    =3D> "2.0.0"
    irb(main):002:0> require 'yaml'
    =3D> true
    irb(main):003:0> YAML.load "[0,1,2]"
    =3D> [0, 1, 2]
    irb(main):004:0>

With 1.8.7:

    >> RUBY_VERSION
    =3D> "1.8.7"
    >> require 'yaml'
    =3D> false
    >> YAML.load "[0,1,2]"
    =3D> [10]
    >>

You can verify the back end you're using via `YAML::ENGINE.yamler`:

    irb(main):004:0> YAML::ENGINE.yamler
    =3D> "psych"
    irb(main):005:0>

Or if you're targeting 1.9.2 and above, just require and use Psych directly:

    irb(main):001:0> require 'psych'
    =3D> true
    irb(main):002:0> Psych.load "[0,1,2]"
    =3D> [0, 1, 2]
    irb(main):003:0>

Hope that helps.

--=20
Aaron Patterson
http://tenderlovemaking.com/

In This Thread

Prev Next