velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Darin Kelkhoff <dar...@sportingnews.com>
Subject too few arguments to macro errors
Date Mon, 12 Nov 2001 22:57:31 GMT
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>


Mime
View raw message