Re: partial evaluation / removing directives

Nathan Bubna <[email protected]>
Newsgroups gmane.comp.jakarta.velocity.user
Message-ID <CAFyaDjEBtkO6d5AUqU=QvdvzfWcuNCHGJqWeEA0ZJQ4_eNweLA@mail.gmail.com>
On Fri, Jul 13, 2012 at 9:02 AM, Alex Fedotov <[email protected]> wrote:
> Well, I did not get into the details, but the idea would be to replace the
> ASTIfStatement with a sequence of AST nodes that would output the "#IF"
> text followed by the result of rewriting the children, etc. followed by the
> "#END" text.
> I think the SimpleNode does not have a particularly friendly public
> interface to facilitate this kind of thing. I remember I had to resort to
> using reflection and accessing protected/private members directly.

sounds like something that could be improved.  you could always open a
JIRA issue for this and/or provide a patch. :)

> Alex
>
>
> As for the AST rewrite idea, if it was possible to "Burn down" nodes to
>> their corresponding text something like that would work, However, wouldnt'
>> that then possibly miss additional child elements in that AST tree? For
>> instance a clause in an if statement which had a resourceBundle reference?
>>  I'm not too familiar with ASTs (been years since I dealt with those at
>> school), maybe I can look at it a bit more today.
>>
>> thanks,
>> Pete
>>
>>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.