aboutsummaryrefslogtreecommitdiff
path: root/cljcc-compiler/src/cljcc/core/exception.cljc
diff options
context:
space:
mode:
authorYour Name <agrawalshagun07@gmail.com>2025-03-16 18:03:26 +0530
committerYour Name <agrawalshagun07@gmail.com>2025-03-16 18:03:26 +0530
commit32499638cef3c49ff686b19b5708d6b08712c526 (patch)
tree31f09287602d243b22660fe455e5174bdcc280b4 /cljcc-compiler/src/cljcc/core/exception.cljc
parent277319fa392f5ee9f21eedf2c4d224739f045690 (diff)
Refactor into cli and cljcc-compiler folders
Pass all tests. Fix babashka tasks and build setup. Repl is behaving in unexpected ways, otherwise working as expected.
Diffstat (limited to 'cljcc-compiler/src/cljcc/core/exception.cljc')
-rw-r--r--cljcc-compiler/src/cljcc/core/exception.cljc34
1 files changed, 0 insertions, 34 deletions
diff --git a/cljcc-compiler/src/cljcc/core/exception.cljc b/cljcc-compiler/src/cljcc/core/exception.cljc
deleted file mode 100644
index 19245aa..0000000
--- a/cljcc-compiler/src/cljcc/core/exception.cljc
+++ /dev/null
@@ -1,34 +0,0 @@
-(ns cljcc.core.exception
- (:require [cljcc.core.format :refer [safe-format]]))
-
-(defn try-catch-ex
- ([f]
- (try
- (f)
- (catch #?(:clj Throwable :cljs :default) e
- [:error e])))
- ([f default]
- (try
- (f)
- (catch #?(:clj Throwable :cljs :default) e
- default))))
-
-(defn lex-error [{line :line col :col :as data}]
- (throw (ex-info
- (safe-format "Invalid token at line: %s, col: %s." line col)
- (merge {:error/type :lexer} data))))
-
-(defn parser-error [msg data]
- (throw (ex-info msg (merge {:error/type :parser} data))))
-
-(defn analyzer-error [msg data]
- (throw (ex-info msg (merge {:error/type :analyzer} data))))
-
-(defn tacky-error [msg data]
- (throw (ex-info msg (merge {:error/type :tacky} data))))
-
-(defn compiler-error [msg data]
- (throw (ex-info msg (merge {:error/type :compiler} data))))
-
-(defn emit-error [msg data]
- (throw (ex-info msg (merge {:error/type :emit} data))))