On Tue, Apr 16, 2002 at 10:44:11AM +0100, [EMAIL PROTECTED] wrote:
> What I could really do with is a "METAFILTER" directive which allows me to work
> on the raw TT template code enclosed in a block. 

Yep, I see what you mean.  You want to be able to intercept any regular text
blocks at parse time and allow your custom parser to kick in to perform any 
extra scanning/parsing/compilation.

Hmmmm... yes that's tricky in v2.  I don't think it's possible without some
fairly major hacking.  The hooks aren't really in the right places to make that
easy.

You could hack the parser to pass any 'TEXT' tokens it identifies off to a 
custom method (but you also have to consider 'ITEXT' tokens which require
further interpolation).  Or maybe you could hack Template::Directive to 
redefine the text() method and do some extra parsing in there.  But I suspect
that dragons may lurk within either of those approaches.

I think this kind of thing should be easier with the architecture of the v3 parser.
I'll check it out and see what it looks like.  Although v3 is still some way off,
the parser is one of the more mature elements and it might be possible to use
it within a v2 framework at some point in the not-too-distant future.

A



Reply via email to