Open chrisrichard opened 10 years ago
Great!
The "Printer" NodeVisitor may helper understanding how different nodes are used, depending on the input (see test/MtHaml/Tests/fixtures/parser/*.test for examples).
Also wondering about the feasibility of detecting whether a particular node is really the first child when there are conditional/loop statements as siblings. I assume this isn't easily/possible?
I can't figure a way of doing that reliably at compile time, sadly. This is possible at runtime, though. E.g. by using a filter to trim leading/trailing whitespaces, or outputing code that conditionally displays the leading linebreak.
Related: #53
These rules are helping in my case but still leave something to be desired. Unclear about the possibility of accessing rendered content of a previous sibling if statement, for eg.