From 05611820413a6f691da269e631f4359185416155 Mon Sep 17 00:00:00 2001 From: Shagun Agrawal Date: Fri, 16 Aug 2024 23:26:10 +0530 Subject: Switch to hand made parser, refactor asts to adjust change Switch to hand made recursive descent parser. Remove instaparse from dependencies. --- src/cljcc/exception.clj | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 src/cljcc/exception.clj (limited to 'src/cljcc/exception.clj') 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 {})))) -- cgit v1.2.3