You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by David Esposito <es...@newnetco.com> on 2001/10/29 19:22:27 UTC
nit picky parser bug
I think I stumbled across a small parser bug ... I want to output the
following:
Dave(1)
Dave(2)
Dave(3)
...
Dave(n)
so I wrote:
#foreach($waterfowl in $duck_blind)
$dave#if($duck_duck_goose > 1)($velocityCount)#end
#end
which runs through the parser just fine ... but if i make it
#foreach($waterfowl in $duck_blind)
$dave.goober#if($duck_duck_goose > 1)($velocityCount)#end
#end
it get a ParseErrorException ... it seems that if the value before the #if
statement has a "dot" in it (doesn't matter what the type of the object is
or whether the object is defined as this error happens at parse time) ...
if i stick a space between $dave.goober and the #if, the problem goes away
..
I'm using the velocity 1.1 release ...
-Dave
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: nit picky parser bug
Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
On 10/29/01 1:22 PM, "David Esposito" <es...@newnetco.com> wrote:
> I think I stumbled across a small parser bug ... I want to output the
> following:
>
> Dave(1)
> Dave(2)
> Dave(3)
> ...
> Dave(n)
>
> so I wrote:
>
> #foreach($waterfowl in $duck_blind)
> $dave#if($duck_duck_goose > 1)($velocityCount)#end
> #end
>
> which runs through the parser just fine ... but if i make it
>
> #foreach($waterfowl in $duck_blind)
> $dave.goober#if($duck_duck_goose > 1)($velocityCount)#end
> #end
>
> it get a ParseErrorException ... it seems that if the value before the #if
> statement has a "dot" in it (doesn't matter what the type of the object is
> or whether the object is defined as this error happens at parse time) ...
>
> if i stick a space between $dave.goober and the #if, the problem goes away
> ..
>
> I'm using the velocity 1.1 release ...
>
That¹s some mighty fancy templating code you write... :)
Yep, that's a bug. Will fix - was in a related area recently, so will be
easy, I think.
geir
--
Geir Magnusson Jr. geirm@optonline.net
System and Software Consulting
"He who throws mud only loses ground." - Fat Albert
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
RE: nit picky parser bug
Posted by David Esposito <es...@newnetco.com>.
yep ... that does ... didn't even think to try that ...
thanks ... i'll use that as my workaround for now ..
-Dave
> -----Original Message-----
> From: bob mcwhirter [mailto:bob@werken.com]
> Sent: Monday, October 29, 2001 1:36 PM
> To: Velocity Users List
> Subject: Re: nit picky parser bug
>
>
>
> I think using the formal notation of ${dave.goober} might solve the
> problem.
>
> http://jakarta.apache.org/velocity/user-guide.html#Formal%20Refere
> nce%20Notation
>
> -bob
>
> On Mon, 29 Oct 2001, David Esposito wrote:
>
> > I think I stumbled across a small parser bug ... I want to output the
> > following:
> >
> > Dave(1)
> > Dave(2)
> > Dave(3)
> > ...
> > Dave(n)
> >
> > so I wrote:
> >
> > #foreach($waterfowl in $duck_blind)
> > $dave#if($duck_duck_goose > 1)($velocityCount)#end
> > #end
> >
> > which runs through the parser just fine ... but if i make it
> >
> > #foreach($waterfowl in $duck_blind)
> > $dave.goober#if($duck_duck_goose > 1)($velocityCount)#end
> > #end
> >
> > it get a ParseErrorException ... it seems that if the value
> before the #if
> > statement has a "dot" in it (doesn't matter what the type of
> the object is
> > or whether the object is defined as this error happens at parse
> time) ...
> >
> > if i stick a space between $dave.goober and the #if, the
> problem goes away
> > ..
> >
> > I'm using the velocity 1.1 release ...
> >
> > -Dave
> >
> >
> > --
> > To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: nit picky parser bug
Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
On 10/29/01 1:35 PM, "bob mcwhirter" <bo...@werken.com> wrote:
>
> I think using the formal notation of ${dave.goober} might solve the
> problem.
>
> http://jakarta.apache.org/velocity/user-guide.html#Formal%20Reference%20Notati
> on
>
> -bob
That does work as a workaround. Will still fix.
Geir
>
> On Mon, 29 Oct 2001, David Esposito wrote:
>
>> I think I stumbled across a small parser bug ... I want to output the
>> following:
>>
>> Dave(1)
>> Dave(2)
>> Dave(3)
>> ...
>> Dave(n)
>>
>> so I wrote:
>>
>> #foreach($waterfowl in $duck_blind)
>> $dave#if($duck_duck_goose > 1)($velocityCount)#end
>> #end
>>
>> which runs through the parser just fine ... but if i make it
>>
>> #foreach($waterfowl in $duck_blind)
>> $dave.goober#if($duck_duck_goose > 1)($velocityCount)#end
>> #end
>>
>> it get a ParseErrorException ... it seems that if the value before the #if
>> statement has a "dot" in it (doesn't matter what the type of the object is
>> or whether the object is defined as this error happens at parse time) ...
>>
>> if i stick a space between $dave.goober and the #if, the problem goes away
>> ..
>>
>> I'm using the velocity 1.1 release ...
>>
>> -Dave
>>
>>
>> --
>> To unsubscribe, e-mail:
>> <ma...@jakarta.apache.org>
>> For additional commands, e-mail:
>> <ma...@jakarta.apache.org>
>>
>
>
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>
--
Geir Magnusson Jr. geirm@optonline.net
System and Software Consulting
You're going to end up getting pissed at your software
anyway, so you might as well not pay for it. Try Open Source.
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: nit picky parser bug
Posted by bob mcwhirter <bo...@werken.com>.
I think using the formal notation of ${dave.goober} might solve the
problem.
http://jakarta.apache.org/velocity/user-guide.html#Formal%20Reference%20Notation
-bob
On Mon, 29 Oct 2001, David Esposito wrote:
> I think I stumbled across a small parser bug ... I want to output the
> following:
>
> Dave(1)
> Dave(2)
> Dave(3)
> ...
> Dave(n)
>
> so I wrote:
>
> #foreach($waterfowl in $duck_blind)
> $dave#if($duck_duck_goose > 1)($velocityCount)#end
> #end
>
> which runs through the parser just fine ... but if i make it
>
> #foreach($waterfowl in $duck_blind)
> $dave.goober#if($duck_duck_goose > 1)($velocityCount)#end
> #end
>
> it get a ParseErrorException ... it seems that if the value before the #if
> statement has a "dot" in it (doesn't matter what the type of the object is
> or whether the object is defined as this error happens at parse time) ...
>
> if i stick a space between $dave.goober and the #if, the problem goes away
> ..
>
> I'm using the velocity 1.1 release ...
>
> -Dave
>
>
> --
> To unsubscribe, e-mail: <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>