StringTemplate Integration

I have added a StringTemplate literal `...` (back quotes):

ST s = `public <name> = <init>;`;
s["name"] = "Ter";
s["init"] = "34";
println(s.toString());
println(s["init"]);

emits

public Ter = 34;
34

The attributes of a template act like dictionary entries.

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
  1. Jan 23, 2008

    Anonymous says:

    Nice...  I wonder if some similar integration with http://ptilde...

    Nice... 

    I wonder if some similar integration with http://ptilde.pbwiki.com/&nbsp;(mainly because its regexp engine) would worth.

  2. Mar 16, 2009

    Anonymous says:

    In version mantra-1.0a4.jar, there is a problem with ("). They need to be backsl...

    In version mantra-1.0a4.jar, there is a problem with ("). They need to be backslashed.

    The following fails to compile in the javac phase:

    ST s = `public <name> = <init; separator=",">;`;
    

    The following works:

    ST s = `public <name> = <init; separator=\",\">;`;
    

Add Comment