(defn
update-reverse-result
"Helper for decode-reverse. Take a reverse source map and\n update it with a segment map."
[result segmap gline]
(let
[{:keys [gcol source line col name]}
segmap
d
{:gline gline, :gcol gcol}
d
(if name (assoc d :name name) d)]
(update-in
result
[source]
(fnil
(fn
[m]
(update-in
m
[line]
(fnil
(fn [m] (update-in m [col] (fnil (fn [v] (conj v d)) [])))
(sorted-map))))
(sorted-map)))))