[pmwiki-devel] Variable Expansion Question.

Stirling Westrup sti at pooq.com
Tue Oct 23 07:31:44 CDT 2007


I'm wondering if anyone has any insight on how Pm avoids recursive loops in
his variable expansion routines. I ask because I need to do something similar
and my reading of the PmWiki code has given me no insight.

This is part of an expansion to the Fox forms system that I need for a
multilingual blog. Form templates can contain variables with names like
{$$foo} and I want to be able to expand nested cases so that I can have
expansions like this:

  {$$foo} => Blog
  {$$bar} => English
  {$${$$foo}-{$$bar}} => {$$Blog-English} => Something

I can easily see how to accomplish this, but I don't want to get into infinite
loops with perverse cases such as:

  {$$foo} => {$$foo}

(ie, the contents of $$foo is the literal string '{$$foo}'). So, somehow I
need to mark text as having already been expanded, and not expand it again,
unless its inside {$$..} brackets. This sounds like something that the Keep
system would be good for, but I'm afraid I just don't get how it works.

I can't use the existing markup engine, since form templates don't get
translated into HTML, so I'm having to write my own routines for it.



More information about the pmwiki-devel mailing list