From: Keats <ke...@su...> - 2003-08-01 17:41:26
|
Stripping the previous newline is definitely a major point of confusion, but it makes sense once you grok it. Making more special cases would, IMHO, not only make the parser more complicated, but also make it harder to learn and remember the rules. To make your example work you just need to add a blank line: [ #if ($someCondition) #begin #if ($someOtherCondition) #begin This is a line This is another line #end #end ] Yes it's confusing, but once you understand it it works fine and it is consistent. If you want a bunch of stuff without newlines you can write: [ #foreach $num in [10, -20, 50, -100] indexing $i #if ($i>1) #begin , #end #if ($num < 0) #begin ($abs($num)) #end #else #begin $num) #end ] to get [10, (20), 50, (100)] Writing this all on one line would really suck. (Note: I haven't tested this example, but it's something like that.) Keats |