velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Darin Kelkhoff <dar...@sportingnews.com>
Subject Re: too few arguments to macro errors
Date Tue, 13 Nov 2001 23:27:18 GMT
yes, while i don't have math to prove it, i do believe our macros do call 
each other too much for us to just rearrange the macro library to avoid these 
errors.

so is there any way to get around this?  can some warning/error control level 
be adjusted anywhere in velocity?  is it a known issue?  i don't want to just 
have to tell everyone to just ignore those hundreds of lines of errors in the 
log...


thanks,
--darin



On Monday 12 November 2001 05:05 pm, Nathan Bubna wrote:
> yeah, we ran into that.  i imagine it is due to the order macros are added.
> while it never seemed to cause any problems, we were able to eschew the
> reported errors by rearranging the order in which our macros are declared.
> but that doesn't appear possible with the example you give.
>
> Nathan Bubna
> nathan@esha.com
>
> ----- Original Message -----
> From: "Darin Kelkhoff" <darink@sportingnews.com>
> To: <velocity-user@jakarta.apache.org>
> Sent: Monday, November 12, 2001 2:57 PM
> Subject: too few arguments to macro errors
>
> > using 1.2, RC2, we have a macro library file with close to 100 macros in
>
> it.
>
> > when the library is parsed, in the log foreach macro we get a message
> > like this:
> >
> >
> > Mon Nov 12 16:27:18 CST 2001   [info] Velocimacro : added new VM :
> > #spacer( ) : source = build/com/tsn/templates/primary_macro_lib
> >
> >
> > there are ~100 lines just like this in sequence in our log.
> > Then, however, after all these lines a new series of lines appear in the
>
> log.
>
> >  they are all in the format:
> >
> >
> > Mon Nov 12 16:27:18 CST 2001  [error] VM #spacer: error : too few
>
> arguments
>
> > to macro. Wanted 3 got 0  -->
> >
> >
> > these lines always complain that macro had too few arguments, but all our
> > templates are rendering fine, all our macro calls are not incorrect.
> >
> > when i further inspected the situation, i noticed that for each macro, it
> > would generate the error message once for each time that macro was
>
> referred
>
> > to in the library file before where that macro was defined.  here's an
> > example:
> >
> >
> > #macro(A $a)
> >   #B(2)
> >   #C(3)
> > #end
> > #macro(B $b)
> >   #A(1)
> >   #C(3)
> > #end
> > #macro(C $c)
> >   #A(1)
> >   #B(2)
> > #end
> >
> > this would generate in the log something like:
> >
> > ...added new VM : #A( )...
> > ...added new VM : #B( )...
> > ...added new VM : #C( )...
> > ...VM #B: error : too few arguments...
> > ...VM #C: error : too few arguments...
> > ...VM #C: error : too few arguments...
> >
> >
> > at least, thats as closely as i can reproduce the situation.
> >
> > does this sound like a problem with our code?  has anyone else seen
>
> something
>
> > like this?  any ideas?
> >
> > any help is appreciated,
> > --darin
> >
> >
> >
> >
> > --
> > Darin Kelkhoff
> > darink@sportingnews.com
> > Programmer
> > The Sporting News
> > www.sportingnews.com
> >
> > --
> > To unsubscribe, e-mail:
>
> <mailto:velocity-user-unsubscribe@jakarta.apache.org>
>
> > For additional commands, e-mail:
>
> <mailto:velocity-user-help@jakarta.apache.org>

-- 
Darin Kelkhoff
darink@sportingnews.com
Programmer
The Sporting News
www.sportingnews.com

--
To unsubscribe, e-mail:   <mailto:velocity-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:velocity-user-help@jakarta.apache.org>


Mime
View raw message