branaway / Japid

A Java-based statically-typed fast template engine that can be used in any Java code. It has special adapter for use with the Play! Framework.
113 stars 18 forks source link

Doesn't support recursion tag. #5

Closed Syvius closed 13 years ago

Syvius commented 13 years ago

Hi, I am a Japid user. When I try to use Japid to resolve a tree, i found it's doesn't support recursion invoke a tag. code example:

nodeTag.html:

`args TreeNode node

`if(!node.getChildren().isEmpty())
`{
        #{Each node.getChildren() | TreeNode child}
            #{nodeTag child /}
        #{/}
`}

It will make a stack over flow exception.

branaway commented 13 years ago

will take a look over the weekend. Thanks for reporting.

branaway commented 13 years ago

Sorry for wrongfully closing the issue. Can you quickly try something like:

if(!node.getChildren().isEmpty()) { for (TreeNode child : node.getChildren()) {

{nodeTag child /}

    `}

`}

branaway commented 13 years ago

I believe the problem was with a minor parsing issue of Japid. Please place the opening brace at the end of the previous if (xxx). The current parser has some problem treating the standalone opening brace.

Syvius commented 13 years ago

Thanks, it works