Airspeed throws an exception if the macro is referenced in the template before it is defined. This works normally in Apache Velocity.
Code example:
import airspeed
t = airspeed.Template("""
#set($value = 'my test')
${instancesuper}
#if(!$!{instancesuper})
missing end
#end
Value is '$value'
#new_macro('A','B')
#macro(new_macro $name $surname)
Your name is $name $surname
#end
Testing macro
#new_macro('A','B')"""
)
print(t.merge(locals()))
This throws a following exception:
raise Exception('no such macro: ' + self.macro_name)
airspeed.TemplateExecutionError: Error in template '<string>' at position 102-121 in expression: #new_macro('A','B')
Exception: no such macro: new_macro
Airspeed throws an exception if the macro is referenced in the template before it is defined. This works normally in Apache Velocity.
Code example:
This throws a following exception: