Velocity
  1. Velocity
  2. VELOCITY-666

Blockmacro support (allows any AST as macro body argument)

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.6.2, 1.7
    • Fix Version/s: 1.7
    • Component/s: None
    • Labels:
      None

      Description

      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

      1. velocity-call-directive.patch
        20 kB
        Jarkko Viinamäki
      2. velocity-blockmacro.patch
        22 kB
        Jarkko Viinamäki

        Issue Links

          Activity

          No work has yet been logged on this issue.

            People

            • Assignee:
              Unassigned
              Reporter:
              Jarkko Viinamäki
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development