Re: H::T::Expr and escape

Michael Peters <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.html-template
Message-ID <[email protected]>

Sam Tregar wrote:
> On Fri, 14 Apr 2006, Michael Peters wrote:
> 
>> So by making the "parser smart enough" do you mean copying that huge
>> regex from H::T and modifying it with the expr regex?
> 
> Yeah, or using Parse::RecDescent.  H::T::E already uses it for
> expressions, so using it for parsing the template itself might not be
> much slower.

I'll try my simple approach and see how that works first.

>> It looks like it also doesn't support 'default'.
> 
> What the heck would default do for expressions?  I can't think of
> anything reasonable...  There's no single variable to examine for a
> value in the general case.

Yeah, that makes sense, I guess I didn't really think it through. Would
it make sense though to allow it to be used if the entire expression
returned false?

>> A very simple approach would be to take any tmpl_vars/loops, etc that
>> use expr and capture anything before the expr="..." and after it and
>> then just add them to the generated tags. This however doesn't solve the
>> sub-ref problem.
> 
> What's the sub-ref problem?

I'm not sure :) I think I just mis-read your other email.

-- 
Michael Peters
Developer
Plus Three, LP



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
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.