From: Oren Ben-K. <or...@ri...> - 2002-12-06 11:54:17
|
Brian Ingerson [mailto:in...@tt...] wrote: > The cool thing about this is that the very common: > > --- > foo: > > Some wrapped text > for your perusing > pleasure. > # is the same as > bar: > Some wrapped text > for your perusing > pleasure. > > Well, not quite. The first one has a trailing new line. They would be identical if you used '>-' as the indicator. > Folded '>' scalars are still important for wikied content but > you would end up seeing them a lot less which is a good thing IMO. Hmmm. I guess so. > We could also support the headerless top level scalar: > > this is a > plain scalar > --- so is this I _knew_ there's a trap there somewhere... I'm reviewing the plain scalar productions, that are a mess since they basically say "anything that doesn't parse using the other productions" :-( Imagine specifying in the productions that a top-level plain scalar in a document without a header can't start with '--- '. Arrgghh! > Of course these top level scalars would be subject to the > restriction of plain scalars. And more (no '--- ')... > Definitely. This could be cool. Let's think on it a bit more though. Lets... > The best reason I can come up with is the following lookahead problem: > > foo: > # xxx > # 10000 more comment lines > is this a plain scalar? Nope: a mapping > > But since '# ' can't be in a plain scalar, the comments can be thrown > away as you parse. So no problem AFAICS. Still thinking... Right. Except that according to the current rules, it isn't possible to embed a comment _inside_ a plain scalar, so... --- foo: abc # bad - comment # bad - comment def ... Is today syntax error. Hence it seems that if we allow plain scalars to start on the next line: --- foo: # bad - comment def bar: # bad - comment abc ... Would also be errors. Thoughts? Have fun, Oren Ben-Kiki |