diff options
Diffstat (limited to 'src/lux/analyser.clj')
-rw-r--r-- | src/lux/analyser.clj | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/lux/analyser.clj b/src/lux/analyser.clj index 42d92b859..44c173864 100644 --- a/src/lux/analyser.clj +++ b/src/lux/analyser.clj @@ -711,3 +711,15 @@ (defn analyse [eval! compile-module compile-token] (|do [asts &parser/parse] (&/flat-map% (partial analyse-ast eval! compile-module compile-token &/$VoidT) asts))) + +(defn clean-output [?var analysis] + (|do [:let [[[?output-type ?output-cursor] ?output-term] analysis] + =output-type (&type/clean ?var ?output-type)] + (return (&&/|meta =output-type ?output-cursor ?output-term)))) + +(defn repl-analyse [eval! compile-module compile-token] + (|do [asts &parser/parse] + (&type/with-var + (fn [?var] + (|do [outputs (&/flat-map% (partial analyse-ast eval! compile-module compile-token ?var) asts)] + (&/map% (partial clean-output ?var) outputs)))))) |