(update-result result segmap gline)
Helper for decode. Take a source map and update it based on a
segment map.
Source
(defn update-result
"Helper for decode. Take a source map and update it based on a
segment map."
[result segmap gline]
(let [{:keys [gcol source line col name]} segmap
d {:line line
:col col
:source source}
d (if name (assoc d :name name) d)]
(update-in result [gline]
(fnil (fn [m]
(update-in m [gcol]
(fnil #(conj % d) [])))
(sorted-map)))))