diff options
| author | Shagun Agrawal <agrawalshagun07@gmail.com> | 2024-11-03 14:53:13 +0530 |
|---|---|---|
| committer | Shagun Agrawal <agrawalshagun07@gmail.com> | 2024-11-03 14:53:13 +0530 |
| commit | a9e828cc6aeab1400217d2af9fa20c93b2183baa (patch) | |
| tree | 1983b863952bee098c0934a4b943601b9a12b954 /src/cljcc/exception.clj | |
| parent | 817731f53df634b1a7e6c5b69c8c0064d2b1c91c (diff) | |
Add parsing for storage class specifiers
Add parsing for extern and static keywords in declarations
Diffstat (limited to 'src/cljcc/exception.clj')
| -rw-r--r-- | src/cljcc/exception.clj | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/cljcc/exception.clj b/src/cljcc/exception.clj index 20d936b..6eec308 100644 --- a/src/cljcc/exception.clj +++ b/src/cljcc/exception.clj @@ -1,7 +1,9 @@ (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 {})))) +(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)))) |
