You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Bill Boland <bo...@attbi.com> on 2002/06/01 06:17:04 UTC

Problem with macro named beginning with "set"

FYI

I encountered a problem using a macro name beginning with "set" 
I assume the parser confuses this with an actual #set( ... ) directive.
I changed "set" to "sit" and it works fine. Easy to get around but I was
wondering if it was a problem that should be corrected in the parser OR
it should be mentioned in the documentation with any other reserved
words that may not begin macro names (parserXXX, includeXXX and ifXXX
worked OK but I didn't try any others).
I am using 1.3rc1 of Velocity with VelocityServlet

Sample template:

#macro( setXXX )
    stuff here
#end
<html>
<body>
#setXXX()
</body>
</html>

produces error:


2002-05-31 21:09:39,040 [HttpProcessor[80][4]] INFO  - Velocimacro :
added new VM : #setXXX( ) : source = cm/test.vm
2002-05-31 21:09:39,040 [HttpProcessor[80][4]] ERROR - Parser Exception:
cm/test.vm : org.apache.velocity.runtime.parser.ParseException:
Encountered "XXX" at line 6, column 5.



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Problem with macro named beginning with "set"

Posted by "Geir Magnusson Jr." <ge...@adeptra.com>.
On 6/1/02 12:17 AM, "Bill Boland" <bo...@attbi.com> wrote:

> FYI
> 
> I encountered a problem using a macro name beginning with "set"
> I assume the parser confuses this with an actual #set( ... ) directive.
> I changed "set" to "sit" and it works fine. Easy to get around but I was
> wondering if it was a problem that should be corrected in the parser OR
> it should be mentioned in the documentation with any other reserved
> words that may not begin macro names (parserXXX, includeXXX and ifXXX
> worked OK but I didn't try any others).
> I am using 1.3rc1 of Velocity with VelocityServlet
> 
> Sample template:
> 
> #macro( setXXX )
>   stuff here
> #end
> <html>
> <body>
> #setXXX()
> </body>
> </html>
> 

I assume this is for an adult site?

 :)

This is fixed in CVS head.  Give it a try.

-- 
Geir Magnusson Jr.
Research & Development, Adeptra Inc.
geirm@adeptra.com
+1-203-247-1713



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>