From: Oren Ben-K. <or...@be...> - 2004-11-12 21:39:50
|
On Friday 12 November 2004 20:51, Clark C. Evans wrote: > ... by this logic %--- can also appear here, or any of the > other delimiters you've proposed - yes? Right :-( > I suppose we could also=20 > require flow collections to be indented. Now that would be nasty. There's no need to require a space before the=20 '{'. > I like the current begin/end markers, and I'd rather not change > them. =A0I see the current issue as a tedious syntax issue, ... It is that, isn't it? <evil grin> > ... So, let me rule-out changing the begin/end markers. OK. > Let's contrast this with an extended version of Brian's solution, > where all content is indented at least one space unless it was a > top level block (not flow) mapping or sequence. Better: all _scalar_ content is indented by at least one space, unless=20 it is a simple key. This is just a "max(n,1)" added in two productions,=20 "flow-content" and "block-content". > With this=20 > alternative, the only issue is plain scalar keys starting with '---' > or '...' we can just ban this sequence _anywhere_ in a plain scalar, > no? This not only solves the problem, but it could perhaps be sold > as an improvement in YAML readability. Banning it everywhere in plain scalars is an extreme overkill, given=20 most of them will be indented anyway. It is better to ban it only where=20 it causes a problem. Simple, too: l-block-mapping(n) ::=3D l-block-map-entry(n)+ l-block-map-entry(n) ::=3D ( s-indent(n) ns-l-block-map-entry(n) ) - l-forbidden-content > I could go with either solution. Oren's proposal, to limit > directives between a '...' (or the begin of the file) and a '---' > seems like the path of least resistence to solve the un-indented > %issue. That proposal was: | - Directives appear at start of stream or following a '...'. | - Directives are always followed by a '---'. | - '...' may be repeated as long as there's nothing but | =A0 comments between the two '...' lines=20 | - %YAML directive is allowed to specify no version number It is actually more complex than the above approach (requires a new=20 variant for %YAML and so on). > Anything I missed? Yes, a decision :-) I'll spare you this time, though. I still itch to use '|---' and '|...'=20 instead of '---' and '...', but given this is out, Brian's way is=20 simpler. So, sed 's/^/ /' it is. I hope this settles everything, so=20 I'll get back to my spec.dbk... Have fun, Oren Ben-Kiki |