You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Jamie Stillman <JS...@CBC-Companies.com> on 2003/09/08 15:39:33 UTC

Possible bug with macros that start with the word 'set'?

Is the default behavior for Velocity to interpret a macro name that starts
with 'set' as the set directive instead of determining if it is a macro name
instead?

Example:

#macro( setPageAttributes )
...
#end

Using #setPageAttributes() results in a Velocity parse error (as follows).

Encountered "PageAttributes" at line ..., column ....
Was expecting one of:
    "(" ...
    <WHITESPACE> ...

Is this a bug or a known 'feature'?  It seems that the VTL parser should be
smart enough to check for whitespace and/or parenthesis after a directive,
as #set'RestOfMacroName' should be distinguishable with #set( .... ) or #set
( ... ).

Thanks,

Jamie Stillman
CBC Companies
jstillm@cbc-companies.com
614.538.6076

There are only 10 kinds of people in the world: 
those who understand binary and those who don't.



Re: Possible bug with macros that start with the word 'set'?

Posted by Peter Romianowski <an...@gmx.de>.
Hi Jamie,

> Is the default behavior for Velocity to interpret a macro name that starts
> with 'set' as the set directive instead of determining if it is a macro name
> instead?
> 
> Example:
> 
> #macro( setPageAttributes )
> ...
> #end
> 
> Using #setPageAttributes() results in a Velocity parse error (as follows).
> 
> Encountered "PageAttributes" at line ..., column ....
> Was expecting one of:
>     "(" ...
>     <WHITESPACE> ...
> 
> Is this a bug or a known 'feature'?  It seems that the VTL parser should be

Bug, feature - call it whatever you want ;) I'd consider it a bug too. Though
not tested I could imagine that other directives are not allowed in macronames
too, like #macro (#foreachWhatever) etc.

Regards,

Peter


Re: Possible bug with macros that start with the word 'set'?

Posted by Ch...@dlr.de.
I did remember a thread on it, believed it was in bugzilla,
but did not find it there in the open bugs looking for it.

Dave, could you give a hint to Jamie how to get the fixed version?
I'm happy to know that development is continuing behind scenes.
Wasn't there a thread on 1.4 being prepared for a RC?

Jamie, could you test it? Maybe mark your new report as duplicate
and close it?

Tnaks for the heads up!
Christoph

Dave Newton wrote:
> On Mon, 2003-09-08 at 12:34, Christoph.Reck@dlr.de wrote:
> 
>>yes it's known (to some of us)... but it is not yet in Bugzilla...
>>
>>Could you please submit it to bugzilla?
> 
> 
> Actually, I believe it was in Bugzilla, fixed (not by me) and marked
> fixed (by me), in the 1.4 tree IIRC.
> 
> Dave
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
> 
> 

-- 
:) Christoph Reck


Re: Possible bug with macros that start with the word 'set'?

Posted by Dave Newton <da...@solaraccess.com>.
On Mon, 2003-09-08 at 12:34, Christoph.Reck@dlr.de wrote:
> yes it's known (to some of us)... but it is not yet in Bugzilla...
> 
> Could you please submit it to bugzilla?

Actually, I believe it was in Bugzilla, fixed (not by me) and marked
fixed (by me), in the 1.4 tree IIRC.

Dave



Re: Possible bug with macros that start with the word 'set'?

Posted by Ch...@dlr.de.
yes it's known (to some of us)... but it is not yet in Bugzilla...

Could you please submit it to bugzilla?

Thanks,
Christoph

Jamie Stillman wrote:
> Is the default behavior for Velocity to interpret a macro name that starts
> with 'set' as the set directive instead of determining if it is a macro name
> instead?
> 
> Example:
> 
> #macro( setPageAttributes )
> ...
> #end
> 
> Using #setPageAttributes() results in a Velocity parse error (as follows).
> 
> Encountered "PageAttributes" at line ..., column ....
> Was expecting one of:
>     "(" ...
>     <WHITESPACE> ...
> 
> Is this a bug or a known 'feature'?  It seems that the VTL parser should be
> smart enough to check for whitespace and/or parenthesis after a directive,
> as #set'RestOfMacroName' should be distinguishable with #set( .... ) or #set
> ( ... ).
> 
> Thanks,
> 
> Jamie Stillman
> CBC Companies
> jstillm@cbc-companies.com
> 614.538.6076
> 
> There are only 10 kinds of people in the world: 
> those who understand binary and those who don't.
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
> 
> 

-- 
:) Christoph Reck