Re: Question on yaml syntax

Kirill Simonov <[email protected]>
Newsgroups gmane.text.yaml.general
Message-ID <[email protected]>
Wong, Shin Guey wrote:
> Previously I am using pysyck to parse the yaml file. But when I tried to use the latest pyYAML, it failed to parse.
> 
> The failing block is like this:
> 
> ----------------------------------
> - { name: foo, def: 0x0, desc: |
>       Foo desc
>       Long foo description
>   }
> ----------------------------------
> 
> It failed on the "desc: |", where "|" is not a valid token.
> 
> So, whether the block above is a valid yaml syntax or pyYAML not able to parse the block above? However, pysyck is working fine for my yaml file.

Syck is wrong, this is not a valid YAML document.  Literal scalars could 
  be only used in the block context, i.e. outside the [] and {} markers.
For instance, the following document is valid and parseable by both 
PyYAML and Syck:

- name: foo
   def: 0x0
   desc: |
     Foo desc
     Long foo description


Thanks,
Kirill

------------------------------------------------------------------------------
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.