Re: Possible bug with null document in libyaml
Kirill Simonov <[email protected]>
| Newsgroups | gmane.text.yaml.general |
|---|---|
| Message-ID | <[email protected]> |
Hi Osamu, > Then, according to the spec, a YAML serializer can encode > an empty string (in YAML 1.1 document) or a null object (in > YAML 1.2 document) as an empty node in all the cases except > for the one where the whole YAML stream becomes empty. > I think an explicit warning should be given in the spec > to clarify this point with some explanation of the > importance of providing a way to serialize zero objects. > It will be very much helpful. I believe all existing yaml processors interpret an empty plain scalar as the null value by default. > > In addition, I point out that any empty string should not > be encoded into empty nodes in YAML 1.1 document in > any sense because it will not be compatible with YAML 1.2. > In YAML 1.2 spec, an empty node represents a null object. > So, anyways, all the YAML 1.1 serializers should be patched > to encode all the empty strings in quoted styles "" or ''. > > > 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. Thanks, Kirill ------------------------------------------------------------------------------ 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