(defn seg->map
"Take a source map segment represented as a vector
and return a map."
[seg source-map]
(let [[gcol source line col name] seg]
{:gcol gcol
:source (nth (:sources source-map) source)
:line line
:col col
:name (when-let [name (-> seg meta :name)]
(nth (:names source-map) name))}))