void invoke(Macro macro,Map namedArgs,List positionalArgs,List bodyParameterNames,TemplateElement[] childBuffer) throws TemplateException, IOException {
  if (macro == Macro.DO_NOTHING_MACRO) {
    return;
  }
  pushElement(macro);
  try {
    final Macro.Context macroCtx=macro.new Context(this,childBuffer,bodyParameterNames);
    setMacroContextLocalsFromArguments(macroCtx,macro,namedArgs,positionalArgs);
    final Macro.Context prevMacroCtx=currentMacroContext;
    currentMacroContext=macroCtx;
    final LocalContextStack prevLocalContextStack=localContextStack;
    localContextStack=null;
    final Namespace prevNamespace=currentNamespace;
    currentNamespace=(Namespace)macroToNamespaceLookup.get(macro);
    try {
      macroCtx.sanityCheck(this);
      visit(macro.getChildBuffer());
    }
 catch (    ReturnInstruction.Return re) {
    }
catch (    TemplateException te) {
      handleTemplateException(te);
    }
 finally {
      currentMacroContext=prevMacroCtx;
      localContextStack=prevLocalContextStack;
      currentNamespace=prevNamespace;
    }
  }
  finally {
    popElement();
  }
}

void invoke ( Macro macro , Map namedArgs , List positionalArgs , List bodyParameterNames , TemplateElement [ ] childBuffer ) throws TemplateException , IOException { if ( macro == Macro . DO_NOTHING_MACRO ) { return ; } pushElement ( macro ) ; try { final Macro . Context macroCtx = macro . new Context ( this , childBuffer , bodyParameterNames ) ; setMacroContextLocalsFromArguments ( macroCtx , macro , namedArgs , positionalArgs ) ; final Macro . Context prevMacroCtx = currentMacroContext ; currentMacroContext = macroCtx ; final LocalContextStack prevLocalContextStack = localContextStack ; localContextStack = null ; final Namespace prevNamespace = currentNamespace ; currentNamespace = ( Namespace ) macroToNamespaceLookup . get ( macro ) ; try { macroCtx . sanityCheck ( this ) ; visit ( macro . getChildBuffer ( ) ) ; } catch ( ReturnInstruction . Return re ) { } catch ( TemplateException te ) { handleTemplateException ( te ) ; } finally { currentMacroContext = prevMacroCtx ; localContextStack = prevLocalContextStack ; currentNamespace = prevNamespace ; } } finally { popElement ( ) ; } }
calls the macro or function with the given arguments and nested block .
