docs: function findTokenIndex(tokens, offset) {
    var min = 0;
    var max = tokens.length - 1;
  
    while (min <= max) {
      var ptr = ((min + max) / 2) | 0;
      var token = tokens[ptr];
      if (endOf(token) <= offset) {
        min = ptr + 1;
      } else if (startOf(token) > offset) {
        max = ptr - 1;
      } else {
        return ptr;
      }
    }
  
    return ptr;
  }