Skip to content

Commit

Permalink
Arrrrggggh
Browse files Browse the repository at this point in the history
  • Loading branch information
ribelo committed Feb 20, 2021
1 parent a4947bd commit 1bcdd1d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/meander/substitute/epsilon.cljc
Expand Up @@ -12,6 +12,8 @@
[meander.util.epsilon :as r.util])
#?(:clj (:import (clojure.lang ExceptionInfo))))

(defmacro if-cljs [then & [else]] (if (:ns &env) then else))

;; ---------------------------------------------------------------------
;; Environment utilities

Expand Down Expand Up @@ -658,7 +660,8 @@
(defn compile [node env]
(let [node (r.subst.syntax/expand-ast node)
env (merge env (make-env node))
[form env] (compile* node env)]
[form env] (compile* node env)
err (if-cljs cljs.core/ExceptionInfo ExceptionInfo)]
(r.match/find env
{:data #{{:error :cata-not-bound}}}
::CATA_NOT_BOUND
Expand All @@ -674,7 +677,7 @@
(if (r.subst.syntax/contains-cata-node? node)
`(try
[~form*]
(catch ExceptionInfo e#
(catch err e#
(if (r.subst.runtime/fail? e#)
r.match.runtime/FAIL
(throw e#))))
Expand Down

0 comments on commit 1bcdd1d

Please sign in to comment.