Brian Ingerson [mailto:ingy@...] wrote:
> OK. But single space *will* be the canonical form, right? And
> single space
> will require no additional syntax, right? Okay by me.
> We can add some extra syntax for varying indentation, but I
> doubt there'll be
> much call for it.
One space can be 'canonical' - I'd define 'canonical' to be 'minimal' - the
shortest possible serialization (that's nicely unambiguous).
As for extra syntax, what I had in mind would not require anything special
99% of the time that one uses *any* indentation.
is indented 4 spaces.
Indentation is simply copied from the first indented line. This works unless
this line has leading spaces. 99% of them won't, so no extra syntax is
called for and one can simply use whatever indentation he wants.
In the 1% (or whatever) of the cases where the first line does contain
leading white space, and only in these cases, one would have to write
> Actually \<k> *would* work. As in:
> - \<3>
> I think it's better to make the number special somehow.
Makes sense. The above could work... How about:
has 3 leading spaces.
also allow: \ ^1
has 3 leading spaces
Given that ^ serves as a marker for start-of-line in regular expressions? I
think it works better.
> I think we need to solve 6.2 *after* solving indentation. (But let's
> keep it in mind of course)
Right. I don't think it would pose any problems though.
So, summary of how I'd like to see this YAC:
1. Indentation is taken from first indented line,
2. except for a next-line leaf node with an explicit indentation annotation
*after* the next-line indicator,
3. which may be separated from the indicator by optional white space,
4. contains an integer - number of columns the value is indented,
5. in the format ^indentation-level
It seems we agree on 1, 2, 4. I don't think you have a problem with 3. As
for 5, there are many syntax forms we could use but I rather like ^ - it is
consistent with YAML's way of annotating stuff (using a prefix character).
Clark is rather silent - I guess he's under water again... I hope it all
works out OK for him.