Examples of STGroup


Examples of org.stringtemplate.v4.STGroup

  public void testEarlyEval() throws Exception {
    String templates = "main() ::= <<\n<f(p=\"x\")>*<f(p=\"y\")>\n>>\n\n"
        + "f(p,q={<({a<p>})>}) ::= <<\n-<q>-\n>>";
    writeFile(tmpdir, "t.stg", templates);

    STGroup group = new STGroupFile(tmpdir + "/t.stg");

    ST st = group.getInstanceOf("main");

    String s = st.render();
    Assert.assertEquals("-ax-*-ay-", s);

    // Calling inspect led to an java.lang.ArrayIndexOutOfBoundsException in
View Full Code Here

Examples of org.stringtemplate.v4.STGroup

  public void testEarlyEval2() throws Exception {
    String templates = "main() ::= <<\n<f(p=\"x\")>*\n>>\n\n"
        + "f(p,q={<({a<p>})>}) ::= <<\n-<q>-\n>>";
    writeFile(tmpdir, "t.stg", templates);

    STGroup group = new STGroupFile(tmpdir + "/t.stg");

    ST st = group.getInstanceOf("main");

    String s = st.render();
    Assert.assertEquals("-ax-*", s);

    // When <f(...)> is invoked only once inspect throws no Exception in
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.