diff options
Diffstat (limited to '')
-rw-r--r-- | src/lux/analyser.clj | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/lux/analyser.clj b/src/lux/analyser.clj index 29043e868..704e4d4c2 100644 --- a/src/lux/analyser.clj +++ b/src/lux/analyser.clj @@ -68,6 +68,12 @@ (&&lux/analyse-variant analyser (&/V &/$Right exo-type) idx values) ))) +(defn ^:private add-loc [meta ^String msg] + (if (.startsWith msg "@") + msg + (|let [[file line col] meta] + (str "@ " file "," line "," col "\n" msg)))) + (defn ^:private aba10 [analyse eval! compile-module compile-token exo-type token] (|case token ;; Arrays @@ -117,7 +123,8 @@ (&&host/analyse-jvm-laload analyse exo-type ?array ?idx) _ - (assert false (str "[Analyser Error] Unknown syntax: " (prn-str (&/show-ast (&/T (&/T "" -1 -1) token))))))) + #(fail* (add-loc (&/get$ &/$cursor %) + (str "[Analyser Error] Unknown syntax: " (prn-str (&/show-ast (&/T (&/T "" -1 -1) token)))))))) (defn ^:private aba9 [analyse eval! compile-module compile-token exo-type token] (|case token @@ -648,12 +655,6 @@ (aba2 analyse eval! compile-module compile-token exo-type token) )) -(defn ^:private add-loc [meta ^String msg] - (if (.startsWith msg "@") - msg - (|let [[file line col] meta] - (str "@ " file "," line "," col "\n" msg)))) - (defn ^:private analyse-basic-ast [analyse eval! compile-module compile-token exo-type token] (|case token [meta ?token] |