You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by "Claude Brisson (JIRA)" <de...@velocity.apache.org> on 2010/03/29 20:01:27 UTC
[jira] Reopened: (VELOCITY-666) Blockmacro support (allows any AST
as macro body argument)
[ https://issues.apache.org/jira/browse/VELOCITY-666?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Claude Brisson reopened VELOCITY-666:
-------------------------------------
Is there any reason not to use #blockmacro instead of introducing a new character? Even Jarkko didn't remember the syntax on the user list... Since 1.7 is not released yet, it's still time to change it.
> Blockmacro support (allows any AST as macro body argument)
> ----------------------------------------------------------
>
> Key: VELOCITY-666
> URL: https://issues.apache.org/jira/browse/VELOCITY-666
> Project: Velocity
> Issue Type: Improvement
> Affects Versions: 1.6.2, 1.7
> Reporter: Jarkko Viinamäki
> Fix For: 1.7
>
> Attachments: velocity-blockmacro.patch, velocity-call-directive.patch
>
>
> Inspired by VELOCITY-583 (BlockMacro support) I implemented the same functionality in a slightly different way.
> The new syntax is:
> #@yourMacroName($arg1 $arg2) any valid velocity AST here #end
> so basically the syntax is exactly the same as for normal macros except you put that @ prefix to the macro name. That tells Velocity that there's a macro AST body that should be passed to the actual macro.
> And in the macro you can refer to the passed body 0-N times. Like:
> #macro(yourMacroName $foo $bar)
> $bodyContent
> #end
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org