[ic] PREFIX-alternate N doesn't handle nested else's properly...

Mike Heins interchange-users@lists.akopia.com
Wed Jun 27 10:52:00 2001


Quoting Jeff Carnahan (jcarnahan@networq.com):
> I've found another issue with IC 4.6.5, concerning the [PREFIX-alternate N]
> tag. It doesn't seem to like [if]'s with [else]'s nested within it.
> 
> i.e.:
> 
> [loop arg="1 2 3 4 5 6 7 8 9 10"]
>     [loop-alternate 2]
>         EVEN
>     [else]
>         ODD
>     [/else]
>     [/loop-alternate]
> [/loop]
> 
> <P>
> 
> [loop arg="1 2 3 4 5 6 7 8 9 10"]
>     [loop-alternate 2]
>         [if type="explicit" condition=`[loop-code] < 5`]
>             EVEN, < 5
>         [else]
>             EVEN, > 5
>         [/else]
>         [/if]
>     [else]
>         ODD
>     [/else]
>     [/loop-alternate]
> [/loop]
> 
> The first example works as it should, however with the second example,
> [loop-alternate 2] believes that the [else] .. [/else] block nested within
> the [if] tag specifies what to display when an odd number is encountered.
>

This affects 4.7.x as well. I think it can be described as a bug now -- before
4.7.x it was simply another example of poor ITL [else] parsing. Since [if ...]
doesn't have problems any more, we can look at some of these other cases.

-- 
Red Hat, Inc., 3005 Nichols Rd., Hamilton, OH  45013
phone +1.513.523.7621      <mheins@redhat.com>

Fast, reliable, cheap.  Pick two and we'll talk.  -- unknown