function getLocationRange(nodes) {
  /** @type {Position | undefined} */
  let start
  /** @type {Position | undefined} */
  let end

  for (const node of nodes) {
    if (!start || comparePositions(node.loc.start, start) === 'less') {
      start = node.loc.start
    }

    if (!end || comparePositions(node.loc.end, end) === 'greater') {
      end = node.loc.end
    }
  }

  if (start === undefined || end === undefined) {
    return undefined
  }

  return { start, end }
}
@param {(VNode | Token)[]} nodes
@returns {SourceLocation | undefined}