bug-autogen
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-autogen] DEFINE and IF


From: David Taylor
Subject: [Bug-autogen] DEFINE and IF
Date: Wed, 24 May 2006 13:33:47 -0400

DEFINE's are processed on both the true (okay) and false (ouch) sides
of an IF.  By contrast, INCLUDE's on the false side are ignored.

To illustrate, consider the following template file fragment:

[+ IF choose_first +]
[+ DEFINE which +]first[+ ENDDEF +]
[+ INCLUDE "if-def-first.tpl" +]
[+ ELSE +]
[+ DEFINE which +]second[+ ENDDEF +]
[+ INCLUDE "if-def-second.tpl" +]
[+ ENDIF +]

And assume that choose_first is true in the current context.

Then, the first DEFINE and INCLUDE:

    [+ DEFINE which +]first[+ ENDDEF +]
    [+ INCLUDE "if-def-first.tpl" +]

will be processed.  Which is fine.  However, the second DEFINE --

    [+ DEFINE which +]second[+ ENDDEF +]

-- which is on the false side of the IF will also be processed.
Ooops.  The INCLUDE on the false side is correctly ignored.

If it's helpful, I will happily supply the a complete set of template
and definition files illustrating the above.

David

p.s. is there a bug database for AutoGen?  The one at savannah appears
to be completely empty.

p.p.s. the above appears to be a problem in both 5.7.2 and 5.8.4.  I
have not tried the head of the CVS trunk.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]