code: private Node initTemplate(Node templateFunctionNode) {
      Node prepped = templateFunctionNode.cloneTree();
      prepTemplatePlaceholders(prepped);
  
      Node body = prepped.getLastChild();
      Node startNode;
      if (body.hasOneChild() && body.getFirstChild().isExprResult()) {
        // When matching an expression, don't require it to be a complete
        // statement.
        startNode = body.getFirstFirstChild();
      } else {
        startNode = body.getFirstChild();
      }
  
      for (int i = 0; i < templateLocals.size(); i++) {
        // reserve space in the locals array.
        this.localVarMatches.add(null);
      }
      for (int i = 0; i < templateParams.size(); i++) {
        // reserve space in the params array.
        this.paramNodeMatches.add(null);
      }
  
      return startNode;
    }
docs: Prepare an template AST to use when performing matches.
  
  @param templateFunctionNode The template declaration function to extract
  the template AST from.
  @return The first node of the template AST sequence to use when matching.