Skip to content

Commit c602865

Browse files
committed
Update to Java commit 697bc8b (2013.09.23): propagate form metadata during go transformations
1 parent fd71113 commit c602865

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

src/clojure/clojure/core/async/impl/ioc_macros.clj

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -341,9 +341,17 @@
341341
:else :default)))
342342

343343
(defn item-to-ssa [x]
344-
(-item-to-ssa x))
345-
346-
;; given an sexpr, dispatch on the first item
344+
(fn [p]
345+
(let [[itm p :as result] ((-item-to-ssa x) p)]
346+
(if (and (instance? clojure.lang.IObj x)
347+
(instance? clojure.lang.IObj itm))
348+
[(with-meta itm
349+
(merge (meta itm)
350+
(meta x)))
351+
p]
352+
result))))
353+
354+
;; given an sexpr, dispatch on the first item
347355
(defmulti sexpr-to-ssa (fn [[x & _]]
348356
x))
349357

@@ -526,7 +534,7 @@
526534
_ (add-instruction (->Recur recurs val-ids))
527535

528536
recur-point (get-binding :recur-point)
529-
537+
530538
_ (add-instruction (->Jmp nil recur-point))]
531539
::terminated))
532540

@@ -538,7 +546,7 @@
538546
else-blk (add-block)
539547
final-blk (add-block)
540548
_ (add-instruction (->CondBr test-id then-blk else-blk))
541-
549+
542550
_ (set-block then-blk)
543551
then-id (item-to-ssa then)
544552
_ (if (not= then-id ::terminated)
@@ -803,7 +811,7 @@
803811
ILock ;;; Lock
804812
(lock [_])
805813
(unlock [_])
806-
814+
807815
impl/Handler
808816
(active? [_] true)
809817
(lock-id [_] 0)
@@ -859,4 +867,3 @@
859867
(-> (parse-to-state-machine body env user-transitions)
860868
second
861869
(emit-state-machine num-user-params user-transitions)))
862-

0 commit comments

Comments
 (0)