From: Oren Ben-K. <or...@ri...> - 2001-07-16 09:13:12
|
Clark C . Evans [mailto:cc...@cl...] wrote: > Or... we could do... > > One: <<T > Imagine this block scalar as being > indented by a tab character. > Two: <<T- > > Leading new line, but not a trailing new line. > > ... > > While we are at it (updating the spec) I'd > like to limit tab(i) production so that it > it is either: > tab(i+1) = tab(i) '\t' > or tab(i+1) = tab(i) ' '+ > > In other words, either a tab, or 1+ spaces, > but not a mixture of tabs and spaces. This > would fit in nicely with the above <<N > mechanism where N in { 1,2,3,... } union { T } I don't know. I agree with Jason that counting characters isn't fun. I think that the '<' indent '>' idea is more friendly - cut&paste of the indent is a friendlier operation for human-edited files. As for each indentation level being ' '+ XOR '\t', I agree it is "good practice" but I don't think it should be enforced in the spec. My problem with the '|' syntax is that it is so, well, *verbose*. And it is actually less human-friendly when editing a file - if you want to paste a chunk of text into your YAML document as a block, you can't just paste & indent it, you need to add these pesky '|' characters to each line. My way you could just paste, indent, and copy the indentation in between the '<' ... '>' pair. This seems like the easiest way you could do it, except of course for the classical Perl way: block: <<ARBITRARY-END-OF-BLOCK block here, not indented ARBITRARY-END-OF-BLOCK I have to admit, it has its charm (simplicity, robustness). True, it isn't indented, but I'm wondering how important that is for a large chunk of pre-formatted text (e.g., code) with reasonably long lines. Especially when this text is given as a value to a key which isn't at the top level: map: % key: % sub-key: % sub-sub-key: |Long line here - more readable? as-opposed-to: <<BLOCK Long line here - less readable? BLOCK I'm having second thoughts... Have fun, Oren Ben-Kiki |