function setLocStart(node, index) {
    if (node.range) {
      node.range[0] = index;
    } else {
      node.start = index;
    }
  }
@param {{range?: [number, number], start?: number}} node
@param {number} index