This does sound frustrating.  A candidate for Velocity 1.5.1.

I'm trying to catch up on some Velocity-related stuff this week; let me take
a look at this.

WILL

On 6/5/07, Nathan Bubna <[EMAIL PROTECTED]> wrote:

On 6/5/07, Erlend Simonsen <[EMAIL PROTECTED]> wrote:
> I'm in the process of upgading our install of Velocity 1.3.1 to 1.5, but
> I'm running into a problem with multi-line comments.
>
> Basically, in a few cases, I'm getting the *# end marker of a multi-line
> comment printed into my HTML output. This only seems to happen when the
> comment is inside a foreach loop, but I'm not 100% positive. (It doesn't
> happen in all foreach loops at least.)
>
> I have also been unsuccessful in creating a simple example triggering
> this problem, so this is probably some edge case, but it's annoying and
> I'd rather not have to go through all templates and convert to
> single-line comments.
>
>
> One of the templates that bug out looks something like this:
> -----------------------
> #parse a.vsp
> #parse b.vsp
>
> #macro (c)
>
>     #foreach ($a in $list)
>     #end
>
>     #parse c.vsp
>
>     #foreach ($ in $list)
>        #* my end of comment markers are printed *#
>        #if (something)
>            #macroPrintingA
>        # else
>            #macroPrintingC
>        # end
>     #end
> #end
>
> #c
>
> ----------------
>
>
> Which gives me an output like this:
> *#A
> *#A
> *#C
> *#C
> *#A
> *#...
>
>
> If I move the comment outside the foreach, it works correctly. It also
> works fine if I move it to the upper foreach.
>
> Any ideas?

Only that this is really weird and that i wish one of the more
parser-savvy devs (Henning? Will? Geir?) would comment.  I stumbled
across essentially the same issue while i was trying to find a
reliable workaround for
http://issues.apache.org/jira/browse/VELOCITY-537.

Something is rotten when it comes to parsing multi-line comments in
complex macro/foreach structures.

I'm going to be focused on VelocityTools for a couple weeks.  After
that, if things are still slow with my company, i'll try to find some
time to dig into the parser and learn enough to figure out what's
going wrong.

> -- Erlend Simonsen
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




--
Forio Business Simulations

Will Glass-Husain
[EMAIL PROTECTED]
www.forio.com

Reply via email to