aboutsummaryrefslogtreecommitdiff
path: root/src/cljcc/exception.clj
blob: 6eec308f68c97363b22393646bd5dfd7aeea82f7 (plain)
1
2
3
4
5
6
7
8
9
(ns cljcc.exception)

(defn lex-error [{line :line col :col :as data}]
  (throw (ex-info
          (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))))