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

(defn lex-error [{line :line col :col msg :msg}]
  (let [err-msg (if (empty? msg)
                  (format "Lexer error. Invalid token at line: %s, col: %s." line col)
                  (format "Lexer error. Invalid token at line: %s, col: %s. %s" line col msg))]
    (throw (ex-info err-msg {}))))