diff options
Diffstat (limited to 'src/cljcc/exception.clj')
| -rw-r--r-- | src/cljcc/exception.clj | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/cljcc/exception.clj b/src/cljcc/exception.clj new file mode 100644 index 0000000..20d936b --- /dev/null +++ b/src/cljcc/exception.clj @@ -0,0 +1,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 {})))) |
