 ;; Merging
 
 (defn merge-source-maps
+  "Merge an internal source map representation of ClojureScript with
+   an internal source map representation of Google Closure Compiler
+   optimization."
   [cljs-map closure-map]
   (loop [line-map-seq (seq cljs-map) new-lines (sorted-map)]
     (if line-map-seq

            [clojure.pprint :as pp]
            [cljs.source-map.base64-vlq :as base64-vlq]))

;; -----------------------------------------------------------------------------
;; Utilities

(defn indexed-sources [sources]
  (->> sources
    (map-indexed (fn [a b] [a b]))
    (reduce (fn [m [i v]] (assoc m v i)) {})))

(defn source-compare [sources]
  (let [sources (indexed-sources sources)]
    (fn [a b] (compare (sources a) (sources b)))))

;; -----------------------------------------------------------------------------
;; Decoding

(defn seg->map [seg source-map]
  (let [[gcol source line col name] seg]
   {:gcol   gcol
    :source (nth (:sources source-map) source)

      (with-meta nseg {:name (+ name rname)})
      nseg)))

(defn update-result
  "Helper for decode. Take an internal source map representation
   organized as nested sorted maps mapping file, line, and column
   and update it based on a segment map and generated line number."
  [result segmap gline]
  (let [{:keys [gcol source line col name]} segmap
        d {:gline gline
           :gcol gcol}
