[stringtemplate-interest] Maps not behaving as I thought...

Thomas Gagne tggagne at gmail.com
Wed Jun 24 14:22:46 PDT 2009


Thanks.

 

I changed it to "$aMap.keys:{k| $k$ maps to $aMap.(k)$}$" and in reply I got
"." Or something like it.  I'll pick it up again later this evening.  I kind
of like using the angle brackets, but I can see how those brackets (<>)
might be confusing when generating XML-ish code.  I'll keep reading and will
return sometime after 9PM EDST.

 

From: stringtemplate-interest-bounces at antlr.org
[mailto:stringtemplate-interest-bounces at antlr.org] On Behalf Of Graham
Wideman
Sent: Wednesday, June 24, 2009 5:13 PM
To: stringtemplate-interest at antlr.org
Subject: Re: [stringtemplate-interest] Maps not behaving as I thought...

 

Tom:

Your source may have got mangled in email, but...   is it possible that you
have not selected appropriate delimiters for your template expressions.

I think the way you are using ST it expects $...$ delimiters on expressions,
and you are using <...>.

-- Graham






            var template = new Antlr.StringTemplate.StringTemplate(@"

<aMap.keys:{k| <k> maps to <aMap.(k)>}>.

");








So the following method, then, does not do as I expect.  Instead it prints,
<aMap.keys:{k| <k> maps to <aMap.(k)>}>.   

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


More information about the stringtemplate-interest mailing list