matches.js
function countIdentifiers (node) {
    if (!node.children) return 0;
    var count = 0, i = 0, len = node.children.length, type;
    for (; i < len; i++) {
      type = node.children[i].type;
      if (type === "identifier" || type === "binder" || type === "key") count += 1;
      else count += countIdentifiers(node.children[i]);
    }
    return count;
  }
function countIdentifiers (node) {
    if (!node.children) return 0;
    var count = 0, i = 0, len = node.children.length, type;
    for (; i < len; i++) {
      type = node.children[i].type;
      if (type === "identifier" || type === "binder" || type === "key") count += 1;
      else count += countIdentifiers(node.children[i]);
    }
    return count;
  }
function countIdentifiers ( node ) { if ( ! node . children ) return 0 ; var count = 0 , i = 0 , len = node . children . length , type ; for ( ; i < len ; i ++ ) { type = node . children [ i ] . type ; if ( type === "identifier" || type === "binder" || type === "key" ) count += 1 ; else count += countIdentifiers ( node . children [ i ] ) ; } return count ; }
Scans all children for a node and counts the number of identifier patterns. Identifier patterns include captures and object keys.
Scans all children for a node and counts the number of identifier patterns . Identifier patterns include captures and object keys .