YAML short-hand hashes cause the parser to crash
------------------------------------------------

                 Key: JRUBY-1911
                 URL: http://jira.codehaus.org/browse/JRUBY-1911
             Project: JRuby
          Issue Type: Bug
    Affects Versions: JRuby 1.0.3
         Environment: OS 10.5.2, Mac Mini CD
            Reporter: Julian Raschke
            Assignee: Thomas E Enebo


The MRI YAML library understands the following syntax:
{{
>> require 'yaml'; YAML.load("foo: { bar }")
=> {"foo"=>{"bar"=>nil}}
}}
Whereas in jruby, it causes a NullPointerException:
{{
irb(main):002:0> require 'yaml'; YAML.parse("foo: { bar }")
NativeException: java.lang.NullPointerException: null
        from BaseConstructorImpl.java:150:in 
`org.jvyamlb.BaseConstructorImpl.constructObject'
        from BaseConstructorImpl.java:289:in 
`org.jvyamlb.BaseConstructorImpl.constructMapping'
        from JRubyConstructor.java:147:in 
`org.jruby.yaml.JRubyConstructor.constructRubyMapping'
...
}}

I couldn't find out whether this is valid YAML or not, but I found it 
documented on a Ruby-ish site, so I happily used it a lot, and can't quickly 
work around this. I think even if it is not valid YAML, it should be fixed for 
consistency with the MRI library.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply via email to