3 ms·
That was the initial behavior, but I’ve changed it to ignore missing intermediate parents. Your example would be (a (b c)). See the “Handling ambiguity” section
by mbostock 8y ago
That was the initial behavior, but I’ve changed it to ignore missing intermediate parents. Your example would be (a (b c)). See the “Handling ambiguity” section I added to the notebook. The nice property of this design is that you can use whatever indentation style you prefer (tabs, 2x spaces, 1x space, etc.) and it will do what you expect as long as you are consistent.
- munk-a 8y agoOh neato. I still think there's something for the philosophy of developing tools that expect a strict format and fail if that format is violated. I've worked in a variety of settings and with a variety of tools, as time goes by I am finding the value of tools that are strict about expectations to provide a more maintainable product over the long haul. If I were writing a project using this style I'd prefer to receive a parse failure in the case of ambiguity, rather than carrying on and hoping it is correct. If data correction needs to happen (i.e. one file that should be single-space indented is triple space indented) I'd prefer to explicitly pre-process the data rather than have a tool that can handle it gracefully.