function groupByLineNumber(nodes) {
  /** @type { { [key: number]: Token[] } } */
  const grouped = {}
  for (const node of nodes) {
    for (let i = node.loc.start.line; i <= node.loc.end.line; ++i) {
      if (!Array.isArray(grouped[i])) {
        grouped[i] = []
      }
      grouped[i].push(node)
    }
  }
  return grouped
}
Group AST nodes by line number, both start and end.

@param {Token[]} nodes the AST nodes in question
@returns { { [key: number]: Token[] } } the grouped nodes
@private