Re: changes to template variable syntax

"Will Guaraldi" <[email protected]>
Newsgroups gmane.comp.web.pyblosxom.devel
Message-ID <[email protected]>
On 9/7/07, Asheesh Laroia <[email protected]> wrote:
> [snip]
>
> I feel fairly strongly that ${foo} is better, but overall this is by no
> means a big deal.  So hopefully I can convince you to use braces, but if
> not, then we'll still be friends and I'll still use your software and
> everything.

I'll wait a couple of days to see if other people have opinions one
way or another.  If curly braces is preferred or no one has opinions
one way or another, I'll switch it to curly braces.

I'm also fiddling with function call support.  So...  the code is
somewhat in flux still.

I want to allow for filter functions to work.  For example:

   $w3cdateme(mtime)

or with a slightly different syntax and semantics:

   $w3cdateme($mtime)

where the mtime is a part of the entry data and $w3cdateme is a
function that's provided by some plugin.  What I want out of this is
for the templating system to call the w3cdateme function with the the
mtime value as the argument.  I'm still fiddling with syntax and such,
though, so we'll see.  Interestingly, this is needed for the registry
plugin which drives the plugin registry on the web-site.  (On a side
note, I just updated the PyBlosxom version on the PyBlosxom web-site
to what's in svn trunk.)

Additionally, a small part of me wants functions of arbitrary depth to
work.  For example:

   $foo($foo($foo($bar)))

However, this isn't possible without a lot of finagling with
post-regexp-matching code since regexps can't do nesting depth.  I
think in order to do this, I'll have to scrap the regexps and build a
variable parser.  I'm not sure if I want to do that yet, but it would
solve some other issues, too.  For example, we don't handle this
situation particularly well:

   \\$foo

The template system sees the second \ before the $ and assume the $ is
now escaped, but doesn't see the \ before the \ which changes the
meaning of the whole thing.

Fun fun fun!

/will

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
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.