On 15/12/2011 12:51, Erik Sundvall wrote:
> Hi!
>
>
> Are you sure that is what it says?
>
> "Double quoted scalars are restricted to a single line when contained
> inside a simple key."

well I read this to say:

  * if you double quote a long String containing line breaks (if you
    don't yet get into different trouble) THEN
  * this scalar cannot be the value of a 'simple key';
  * a 'simple key' is defined as:
      o A /simple key/
        <http://yaml.org/spec/current.html#index-entry-simple%20key> has
        no identifying mark. It is recognized as being a key either due
        to being inside a flow mapping, or by being followed by an
        explicit value. Hence, to avoid unbound lookahead in YAML
        processors <http://yaml.org/spec/current.html#processor/>,
        simple keys are restricted to a single line and must not span
        more than 1024 stream
        <http://yaml.org/spec/current.html#stream/syntax> characters
        (hence the need for the /flow-key context/
        <http://yaml.org/spec/current.html#index-entry-flow-key%20context>).
        Note the 1024 character limit is in terms of Unicode characters
        rather than stream octets, and that it includes the separation
        <http://yaml.org/spec/current.html#separation%20space/>
        following the key itself.

maybe I misunderstood that a 'simple key' can't have quotes, but in any 
case, the concept of a 'simple key', if the object of YAML is object 
data serialisation is ... pretty strange (if they are hash keys, then 
they are normal strings, there should be no problem. Not distingishing 
between hash keys and attribute names seems to be a problem in YAML as 
for JSON. Very odd design IMO). Why the syntactic structure of a 'value' 
should have any dependence on the syntactic structure of a 'key' is 
beyond me.

Anyway, for the moment I will stick with the format (for Strings):

     unquoted_key: "double quoted string"

this format passes the online parser tests, and handles multi-line 
strings better. Otherwise you have to use '|', '>' and or '\' markers 
all over the place.

- thomas

-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://lists.openehr.org/mailman/private/openehr-technical_lists.openehr.org/attachments/20111215/05fa19d7/attachment.html>

Reply via email to