Re: Possible bug with null document in libyaml

Osamu TAKEUCHI <[email protected]>
Newsgroups gmane.text.yaml.general
Message-ID <[email protected]>
Hi Kirill,

>> BTW, I do not think a YAML 1.1 library will accept "x" as a valid YAML 
>> stream if the library strictly implements the specification. In YAML 
>> 1.1, a plain scalar node must be followed by s-l-comments that contains 
>> at least one line break. So, "x\n" is a valid document but "x" is not.
> 
> I don't think any pre-YAML 1.2 processors uses the grammar described in 
> the spec as the basis for the parser.

I read that Oren modified the spec in YAML 1.2 to accept an input without
a line break at the end of the stream merely for JSON compatibility. 
I thought that YAML 1.1 spec refused such an input not accidentally but 
intentionally.

http://sourceforge.net/mailarchive/forum.php?thread_name=200e06280904252219i1da33755h200bdac14058ba36%40mail.gmail.com&forum_name=yaml-core

Anyway, as I wrote, I don't think so, too, except for the reference 
parser. ;p


>> According to the spec, this change was done for JSON compatibility.
>> A YAML 1.2 processor seems to be required to construct a null object 
>> from an empty node.
>>
>> In this point, YAML 1.2 is completely incompatible from YAML 1.1.
>> Please compare example 7.3 in YAML 1.2 spec with example 8.13 in YAML 
>> 1.1 spec.
>>
> 
> I don't think it's the correct interpretation of the spec.  I'd say that 
> YAML 1.2 provide a recommended scheme for tag resolution, while YAML 1.1 
> doesn't, leaving the decision of choosing the default scheme to the 
> processor authors.  I believe all existing YAML producers interpret an 
> empty plain scalar as a null value unless instructed otherwise.

Fmm, I didn't know that.

I don't understand how we can interprete YAML 1.1 spec as you wrote 
with provided example 8.13 and 8.15, but if only I misinterpreted 
the spec, I'm happier to hear that. I was affraid to have the 
possible incompatibility between YAML 1.1 and 1.2.

Best,
Osamu Takeuchi


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.