Re: Draft 2008-04-06

Oren Ben-Kiki <[email protected]>
Newsgroups gmane.text.yaml.general
Message-ID <1207779802.5445.131.camel@nero>
The "-1" problem was due to the "plain scalar vs. anything else"
ambiguity. The short of it is, the c-l-block-seq-entry production
should only match the "-" if it is not followed by a non-space
character. Makes perfect sense, otherwise the - obviously starts a plain
scalar... I added this negative lookahead annotation to the productions
running ypaste, it seemed to have solved the problem.

Of course, if the parser did any backtracking, it would have been able
to resolve this itself, but I don't have much faith in backtracking
parsers :-)

"Precariously balanced between user friendliness and chaos" indeed :-)

I'll upload a new draft (and YamlReference) on the weekend with all the
fixes so far, including this one.

Nice catch Brad!

In other news - after discussing the issue on the IRC channel, Clark,
Kirill and myself agreed it is reasonable to restrict tags properties to
avoid using the , [ ] { } and characters. These would still be allowed
in verbatim tags (i.e. !<foo,[]{}> bar) and in the tag directive (e.g. %
TAG !! tag:yaml.org,2002: uses the ",").

Clark also wants to ban the ' character there - the use case is parsing
something like [!foo:'bar']. Currently this would parse as [!<!
foo:'bar'> ""]. If ' was invalid in tag properties, it would have been
parsed as [!<!foo:> "bar"]. I'm not certain this is an improvement...

An alternative is to enhance the JSON compatibility rules to state
that :" :' :, :{ :} :[ :] all indicate a key/value pair, as in a:"b" and
c:[1,2]. If this were the case then banning ' from tag properties would
make sense and [!foo:'bar'] would be parsed as [{!<!foo> '': 'bar'}] as
expected.

This seems to me to be the less surprising thing to do, however it means
a bit more of a change.

Opinions?

Oren.



-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
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.