[stringtemplate-interest] summarizing white space and indentation

Jonathan Buhacoff jonathan at buhacoff.net
Mon Nov 9 20:34:52 PST 2009


On Nov 9, 2009, at 4:08 PM, Sam Harwell wrote:

> Just to toss out another idea, I believe it would be possible to keep
> *all* whitespace with following 3 exceptions:
>
> 1. The single newline after <<
> 2. The single newline before >>
>
> All confusion can be cleared up by *requiring* a single newline  
> after <<
> and requiring the >> fall on a line by itself. To write the template  
> on
> one line, use "template text" as before.
>

+1,   I think that's a good proposal for templates in a group file.   
Very similar to "here document" rules from other languages.


> 3. By default, trim trailing whitespace from the end of each line of  
> the
> final output, but allow this to be overridden in code.
>

I don't really understand the need for #3, or maybe I prefer the  
default to be the other way - I prefer to leave the inside template  
alone unless the programmer says otherwise.


> ...
>



More information about the stringtemplate-interest mailing list