On Fri, 3 Aug 2001, Andy Levine wrote: > So, I hoped I could ask the template engine, "Give me a list of values you > need", it would return "Sure, (ip, hostname)" then I could get JUST the > ones I wanted. Then I would, process(template, list); and all would be > well.
The problem is not telling what veriables are being accessed. That would be a simple enough hack to the parser to have it maintain a list of all variables accessed (ignoring plugins and EVAL_PERL). The problem is telling where each variable is defined. The following are all a little tricky: ------- [% IF bar %] [% SET foo = 'baz' %] <-- this one's ambiguous -- impossible to know [% END %] [% foo %] ------- [% INCLUDE block bar = 2 %] <-- this one's not impossible, just tricky [% BLOCK block %] [% bar %] [% foo %] [% END %] -------- I really don't see any way of doing it that has any chance of being 100% correct. ++t Tony Payne : Sr. Software Engineer : PETsMART.com : 626-817-7151
