From 8b39c3d8f9b9817c5455f8fe76ce5e9ef568c885 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Sun, 2 Oct 2016 02:00:29 -0400 Subject: - Now adding cursor information when analysing function/macro calls, to avoid missing cursors during macro-expansions and some function calls. --- src/lux/analyser.clj | 10 ++++++---- src/lux/analyser/lux.clj | 6 ++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/lux/analyser.clj b/src/lux/analyser.clj index 2ad3745d8..f97a0ea08 100644 --- a/src/lux/analyser.clj +++ b/src/lux/analyser.clj @@ -171,8 +171,9 @@ (&&lux/analyse-program analyse optimize compile-program ?args ?body))) ;; else - (|do [=fn (just-analyse analyse (&/T [command-meta command]))] - (&&lux/analyse-apply analyse cursor exo-type =fn parameters))) + (&/with-cursor cursor + (|do [=fn (just-analyse analyse (&/T [command-meta command]))] + (&&lux/analyse-apply analyse cursor exo-type =fn parameters)))) (&/$IntS idx) (&/with-analysis-meta cursor exo-type @@ -183,8 +184,9 @@ (analyse-variant+ analyse exo-type ?ident parameters)) _ - (|do [=fn (just-analyse analyse (&/T [command-meta command]))] - (&&lux/analyse-apply analyse cursor exo-type =fn parameters))) + (&/with-cursor cursor + (|do [=fn (just-analyse analyse (&/T [command-meta command]))] + (&&lux/analyse-apply analyse cursor exo-type =fn parameters)))) _ (&/fail-with-loc (str "[Analyser Error] Unknown syntax: " (prn-str (&/show-ast (&/T [(&/T ["" -1 -1]) token]))))) diff --git a/src/lux/analyser/lux.clj b/src/lux/analyser/lux.clj index b4f87f140..8ecb2c247 100644 --- a/src/lux/analyser/lux.clj +++ b/src/lux/analyser/lux.clj @@ -409,12 +409,10 @@ (&/flat-map% (partial analyse exo-type) macro-expansion)) _ - (&/with-analysis-meta cursor exo-type - (do-analyse-apply analyse exo-type =fn ?args)))) + (do-analyse-apply analyse exo-type =fn ?args))) _ - (&/with-analysis-meta cursor exo-type - (do-analyse-apply analyse exo-type =fn ?args))) + (do-analyse-apply analyse exo-type =fn ?args)) )) (defn analyse-case [analyse exo-type ?value ?branches] -- cgit v1.2.3