Re: example 7.17 in YAML 1.2 spec 2009-07-21

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

>> On Wed, 2009-09-30 at 15:20 +0900, Osamu TAKEUCHI wrote:
>>>> On Thu, 2009-09-03 at 03:34 +0900, Osamu TAKEUCHI wrote: 
>>>>> I noticed the example 7.17. is not reproduced by my 
>>>>> parser nor ypaste. To reproduce the result, it is required to 
>>>>> replace ( ":" followed by an ns-char ) in the the definition 
>>>>> of ns-plain-char(c) by ( ":" followed by an ns-plain-safe(c) ).
>>>> I don't see how. The example does work in ypaste. "followed by ns-char"
>>>> obviously allows _more_ than "followed by ns-plain-safe(c)". This does
>>>> not matter, since the following character is _not_ consumed by this
>>>> production, and is left to be consumed by a normal ns-plain-char
>>>> production later.
>>> ypaste seems to accept "omitted value:" as the key, instead of 
>>> "omitted value".
>> Yikes! You are right. Two nits though:
>> First, it should be followed by ns-plain-char and not ns-plain-safe.
> 
> Yes, this makes more sense.

Sorry, I did not think enough for this issue.


Imagine an input:

{::::}

With the new rule set, I at first expected the next.

!!map
  ? !!str ":::"
  : !!null

But actually, this input became invalid under the new rule set.

Note that when the last ":" is not ns-plain-char(c), 
the previous one is not ns-plain-char(c), then
the previous one is not ns-plain-char(c), then
the previous one is not ns-plain-first(c).


On the other hand, when we have ( ns-plain-safe(c) | "#" )
at the last,

{::::a}

this will be successfully parsed as the next.

!!map
  ? !!str "::::a"
  : !!null

This is confusing.


The answer seems to be the next.

( ":" /* Followed by ( ns-plain-safe(c) | "#" | ":" ) */ )


Best,
Osamu TAKEUCHI

------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
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.