docs: function(ast, filter) {
    checkASTandFunction(ast, 'ast', filter, 'filter');
  
    let result = [];
    walkNodes(ast, node => {
      if (filter(node)) result.push(Object.assign({}, node));
    });
    return result;
  }