Uploaded image for project: 'Velocity'
  1. Velocity
  2. VELOCITY-666

Blockmacro support (allows any AST as macro body argument)

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.6.2, 1.7
    • 1.7
    • None
    • 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

      Attachments

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

        Issue Links

          Activity

            People

              Unassigned Unassigned
              wyla Jarkko Viinamäki
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: