Package com.google.template.soy.soytree

Examples of com.google.template.soy.soytree.SoyFileSetNode



  public void testGenerateExtractedMsgsFile() throws Exception {

    URL testSoyFile = Resources.getResource(XliffMsgPluginTest.class, "test_data/test-v2.soy");
    SoyFileSetNode soyTree =
        (new SoyFileSetParser(SoyFileSupplier.Factory.create(testSoyFile, SoyFileKind.SRC)))
            .parse();
    SoyMsgBundle msgBundle = (new ExtractMsgsVisitor()).exec(soyTree);

    XliffMsgPlugin msgPlugin = new XliffMsgPlugin();
View Full Code Here


        "/***/\n" +
        "{template .ccc}\n" +
        "  {call .aaa /} {$ij.moo} {$ij.boo}\n" +
        "{/template}\n";

    SoyFileSetNode soyTree = SharedTestUtils.parseSoyFiles(fileContent);
    TemplateRegistry templateRegistry = new TemplateRegistry(soyTree);

    TemplateNode aaa = soyTree.getChild(0).getChild(0);
    TemplateNode bbb = soyTree.getChild(0).getChild(1);
    TemplateNode ccc = soyTree.getChild(0).getChild(2);

    // Test with exec(aaa).
    // Exercises: processCalleeHelper case 3 (ccc-> aaa).
    // Exercises: processCalleeHelper case 5 with incorporateCalleeVisitInfo case 3 (bbb -> ccc).
    // Exercises: processCalleeHelper case 5 with incorporateCalleeVisitInfo case 2 (aaa -> bbb).
View Full Code Here

        "/***/\n" +
        "{template .ddd}\n" +
        "  {$ij.boo} {$ij.too} {call .bbb /}\n" +
        "{/template}\n";

    SoyFileSetNode soyTree = SharedTestUtils.parseSoyFiles(fileContent);
    TemplateRegistry templateRegistry = new TemplateRegistry(soyTree);

    TemplateNode aaa = soyTree.getChild(0).getChild(0);
    TemplateNode bbb = soyTree.getChild(0).getChild(1);
    TemplateNode ccc = soyTree.getChild(0).getChild(2);
    TemplateNode ddd = soyTree.getChild(0).getChild(3);

    // Test with exec(aaa).
    // Exercises: processCalleeHelper case 4 with incorporateCalleeVisitInfo case 4 (ccc -> ddd).
    FindIjParamsVisitor fuipv = new FindIjParamsVisitor(templateRegistry);
    fuipv.exec(aaa);
View Full Code Here

        "/***/\n" +
        "{template .ccc}\n" +
        "  {$ij.moo} {$ij.boo} {call .bbb /}\n" +
        "{/template}\n";

    SoyFileSetNode soyTree = SharedTestUtils.parseSoyFiles(fileContent);
    TemplateRegistry templateRegistry = new TemplateRegistry(soyTree);

    TemplateNode aaa = soyTree.getChild(0).getChild(0);
    TemplateNode bbb = soyTree.getChild(0).getChild(1);
    TemplateNode ccc = soyTree.getChild(0).getChild(2);

    // Test with exec(aaa).
    // Exercises: processCalleeHelper case 4 with incorporateCalleeVisitInfo case 3 (ccc -> bbb).
    FindIjParamsVisitor fuipv = new FindIjParamsVisitor(templateRegistry);
    fuipv.exec(aaa);
View Full Code Here

        "/***/\n" +
        "{template .ddd}\n" +
        "  {$ij.boo} {$ij.moo} {round($ij.zoo)}\n" +
        "{/template}\n";

    SoyFileSetNode soyTree = SharedTestUtils.parseSoyFiles(fileContent);
    TemplateRegistry templateRegistry = new TemplateRegistry(soyTree);

    TemplateNode bbb = soyTree.getChild(0).getChild(0);
    TemplateNode aaa = soyTree.getChild(0).getChild(1);
    TemplateNode ccc = soyTree.getChild(0).getChild(2);
    TemplateNode ddd = soyTree.getChild(0).getChild(3);

    ImmutableMap<TemplateNode, IjParamsInfo> templateToIjParamsInfoMap =
        (new FindIjParamsVisitor(null)).execForAllTemplates(soyTree);
    assertEquals(4, templateToIjParamsInfoMap.size());
    assertEquals(3, templateToIjParamsInfoMap.get(ddd).ijParamToCalleesMultimap.size());
View Full Code Here

        "\n" +
        "/** @param b4 */\n" +
        "{template .four}\n" +
        "{/template}\n";

    SoyFileSetNode soyTree = SharedTestUtils.parseSoyFiles(fileContent1, fileContent2);

    SoyFileNode a = soyTree.getChild(0);
    TemplateNode a0 = a.getChild(0);
    TemplateNode a1 = a.getChild(1);
    //TemplateNode a2 = a.getChild(2);
    TemplateNode a3 = a.getChild(3);
    //TemplateNode a4 = a.getChild(4);
    TemplateNode a5 = a.getChild(5);
    TemplateNode a6 = a.getChild(6);
    SoyFileNode b = soyTree.getChild(1);
    //TemplateNode b0 = b.getChild(0);
    TemplateNode b1 = b.getChild(1);
    //TemplateNode b2 = b.getChild(2);
    TemplateNode b3 = b.getChild(3);
    TemplateNode b4 = b.getChild(4);
View Full Code Here

        " */\n" +
        "{template name=\".foo\"}\n" +
        "  {$goo}\n" +
        "{/template}\n";

    SoyFileSetNode soyTree = SharedTestUtils.parseSoyFiles(testFileContent);
    TemplateNode template = (TemplateNode) SharedTestUtils.getNode(soyTree);

    assertTrue(template.getSoyDoc().contains("blah"));
    assertTrue(template.getSoyDocDesc().contains("blah"));
    assertTrue(template.getSoyDocParams().get(0).desc.contains("blah"));
View Full Code Here

TOP

Related Classes of com.google.template.soy.soytree.SoyFileSetNode

Copyright © 2018 www.massapicom. 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.