[stringtemplate-interest] proposed "ignore newlines" template syntax

Jonathan Buhacoff jonathan at buhacoff.net
Mon Apr 4 12:24:13 PDT 2011


You could take that idea even further and only escape "" if it's on a line by itself or followed only by whitespace.

t() ::= "" 
System.out.println("no need to escape double quotes");
No need to escape double-double quotes ("") either unless they are on a line by themselves:
\""
""

Jonathan

On Apr 4, 2011, at 9:20 PM, Sam Harwell wrote:

> That was my concern.
>  
> Thinking about it more, it seems you shouldn’t need to escape the quotes unless there are two of them, in which case you could use "\" to produce two sequential quotes in the output.
>  
> Sam
>  
> From: stringtemplate-interest-bounces at antlr.org [mailto:stringtemplate-interest-bounces at antlr.org] On Behalf Of Collin Fagan
> Sent: Monday, April 04, 2011 1:03 PM
> To: Terence Parr
> Cc: stringtemplate-interest List
> Subject: Re: [stringtemplate-interest] proposed "ignore newlines" template syntax
>  
> Will using "" require people to escape a single " in a template?
> 
> t() ::= "" 
> System.out.println(\"hi\");
> ""
> Collin
> 
>  
> _______________________________________________
> stringtemplate-interest mailing list
> stringtemplate-interest at antlr.org
> http://www.antlr.org/mailman/listinfo/stringtemplate-interest

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/stringtemplate-interest/attachments/20110404/d7036f05/attachment.html 


More information about the stringtemplate-interest mailing list