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

Oren Ben-Kiki <[email protected]>
Newsgroups gmane.text.yaml.general
Message-ID <1254320902.5043.221.camel@nero>
On Wed, 2009-09-30 at 22:05 +0900, Osamu TAKEUCHI wrote:
> 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.

I must say I _like_ this being an error.
The idea is that ':' is treated as part of the plain character if it is
followed by something that makes it _clear_ it is not a key:value
separator.
Obviously in this case, there's no such indication.
IMO _however_ you interpret it, some people will be confused.

Given out #1 goal is readability, I think treating this as an error is a
_good thing_.

> The answer seems to be the next.
> 
> ( ":" /* Followed by ( ns-plain-safe(c) | "#" | ":" ) */ )

There's no need to add '#' since it will be caught by ns-plain-char(c)
since it is not preceded by a space.

Nope, I think the rule as it is now actually does the right thing...

Have fun,

    Oren Ben-Kiki

P.S. Your post did remind me I forgot to flip the order of goals #2 and
#3, I just did that. Lets consider this a loooong September 29th ;-)

Oren.


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