Package com.google.template.soy.soytree

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


        "{/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


        "{/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

        "{/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

        "{/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);

    IndirectParamsInfo ipi = (new FindIndirectParamsVisitor(null)).exec(a0);
    assertEquals(false, ipi.mayHaveIndirectParamsInExternalCalls);
    assertEquals(false, ipi.mayHaveIndirectParamsInExternalDelCalls);
View Full Code Here

        "{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"));

    (new ClearSoyDocStringsVisitor()).exec(soyTree);

    assertNull(template.getSoyDoc());
    assertNull(template.getSoyDocDesc());
    assertNull(template.getSoyDocParams().get(0).desc);
  }
View Full Code Here

TOP

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

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.