From: Oren Ben-K. <or...@be...> - 2006-04-14 05:54:36
|
Now that we have hopefully covered JSON compatibility :-) there is an open issue with regard to indenting flow content. The driving force is the following case: key: [ ] Which even appears as an (erroneous) example in the spec. The simple thing is to allow flow content to be non-indented. This leads to all sort of problems, ranging from readability to breaking all type of heuristics (folding, error bounding, etc.). The worst is: --- foo: "string containing ... --- oops!" Today, we _know_ that a ... line ends a document and a --- line starts a new one. Allowing flow content to be non-indented breaks that. YAML was designed to allow efficient streaming, and being able to break a stream into documents without parsing is important to us. Here is an alternative. Today the rule is that all the flow content must be more-indented than the parent node. Instead, we can change the rule so that all scalar content must be more indented. The { [ , ] } indicators only need to be "as indented" as the parent node. This would mean: --- foo: bar: { "ok", ok } # ok baz: [ "bad", bad ] # bad ... This allows the intuitive placement of the end } ] where a C/JS programmer would expect it to be, while preserving all the methods based off indentation (folding, error bounding, document separation, etc.). Thoughts? Have fun, Oren Ben-Kiki |