docs: function positionToOffset(str, desiredLine, desiredCol) {
      if (desiredLine === 1) {
          return desiredCol - 1;
      }
      let line = 1;
      let lastNewLineOffset = -1;
      do {
          if (desiredLine === line) {
              return lastNewLineOffset + 1 + desiredCol - 1;
          }
          lastNewLineOffset = str.indexOf('\n', lastNewLineOffset + 1);
          line++;
      } while (lastNewLineOffset >= 0);
      return -1;
  }