   [this ^JestParser$ConditionalContext ctx]
 
   (let [conditions (map #( .. this (visitExpression %)) (merge-items (. ctx ifCondition) (. ctx elifExpression)))
-        results (map #(.. this (visitBlock %)) (merge-items (. ctx iftrue) (. ctx elifBlock)))
-        else (if (. ctx elseBlock) (.. this (visitBlock (. ctx elseBlock))) nil)
+        results (map #(wrap-in-do (.. this (visitBlock %))) (merge-items (. ctx iftrue) (. ctx elifBlock)))
+        else (if (. ctx elseBlock) (wrap-in-do (.. this (visitBlock (. ctx elseBlock)))) nil)
         single-if (= (. conditions size) 1)]
 
     (cond

      `(doall (map ~func ~@iterator)))))


(defn- wrap-in-do
  [expressions]
  (cond
    (not (instance? List expressions)) expressions
    (= 0 (count expressions)) (throw (new NotImplementedException))
    (= 1 (count expressions)) (first expressions)
    :else `(do ~@expressions)))


(defn -visitBlock
  "A block doesn't return a list, it only returns a single expression.
  However, if there are multiple expressions coming from that block,
  it wraps them in a do expression"
  [this ^JestParser$BlockContext ctx]

  (cond
    (. ctx expression) (self-visit this ctx expression)

    ;;(. ctx term) (into [] (map #(.. this (visitStatementTerm %)) (. ctx term)))

    (. ctx term) (let [num-terms (.. (. ctx term) size)]
                   (cond
                     (= 0 num-terms) (throw (new NotImplementedException))
                     (= 1 num-terms) (.. this (visitStatementTerm (.. (. ctx term) (get 0))))
                     :else `(do ~@(into [] (map #(.. this (visitStatementTerm %)) (. ctx term))))))

    ;;(. ctx scope) (into [] (map #(.. this (visitVarScope %)) (. ctx scope)))

    (. ctx scope) (let [num-scopes (.. (. ctx scope) size)]
                    (cond
                      (= 0 num-scopes) (throw NotImplementedException)
                      (= 1 num-scopes) (.. this (visitVarScope (.. (. ctx scope) (get 0))))
                      :else `(do ~@(into [] (map #(.. this (visitVarScope %)) (. ctx scope))))))

    :else (throw (new ClojureSourceGenerator$BadSource ctx))))


    :else [obj]))


(defn- wrap-in-do
  [expressions]
  (cond
    (not (instance? List expressions)) expressions
    (= 0 (count expressions)) (throw (new NotImplementedException))
    (= 1 (count expressions)) (first expressions)
    :else `(do ~@expressions)))


;; HELPER
(defn merge-items
  "Takes two items and joins them as a single sequence."
