From 63ce105dd1c1a0af090582900dddd4bd0ec7824b Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Mon, 3 Oct 2016 21:09:13 -0400 Subject: - Fixed a bug wherein compiler code was relying on analyzer tags, instead of optimizer tags. --- src/lux/compiler/host.clj | 2 +- src/lux/compiler/lambda.clj | 2 +- src/lux/compiler/lux.clj | 4 ++-- src/lux/compiler/type.clj | 21 +++++++++++---------- 4 files changed, 15 insertions(+), 14 deletions(-) diff --git a/src/lux/compiler/host.clj b/src/lux/compiler/host.clj index c59a616d8..77eeb8559 100644 --- a/src/lux/compiler/host.clj +++ b/src/lux/compiler/host.clj @@ -439,7 +439,7 @@ (.visitFieldInsn Opcodes/PUTFIELD class-name captured-name clo-field-sig)) (->> (let [captured-name (str &&/closure-prefix ?captured-id)]) (|case ?name+?captured - [?name [_ (&a/$captured _ ?captured-id ?source)]]) + [?name [_ (&o/$captured _ ?captured-id ?source)]]) (doseq [?name+?captured (&/->seq env)]))) (.visitInsn Opcodes/RETURN) (.visitMaxs 0 0) diff --git a/src/lux/compiler/lambda.clj b/src/lux/compiler/lambda.clj index 32650e262..084c38b80 100644 --- a/src/lux/compiler/lambda.clj +++ b/src/lux/compiler/lambda.clj @@ -132,7 +132,7 @@ (.visitInsn Opcodes/DUP))] _ (&/map% (fn [?name+?captured] (|case ?name+?captured - [?name [_ (&a/$captured _ _ ?source)]] + [?name [_ (&o/$captured _ _ ?source)]] (compile nil ?source))) closed-over) :let [_ (when (> arity 1) diff --git a/src/lux/compiler/lux.clj b/src/lux/compiler/lux.clj index 3c19d70e5..7bb97260e 100644 --- a/src/lux/compiler/lux.clj +++ b/src/lux/compiler/lux.clj @@ -222,13 +222,13 @@ (defn ^:private compile-def-type [compile ?body] (|do [:let [?def-type (|case ?body - [[?def-type ?def-cursor] (&a/$ann ?def-value ?type-expr ?def-value-type)] + [[?def-type ?def-cursor] (&o/$ann ?def-value ?type-expr ?def-value-type)] ?type-expr [[?def-type ?def-cursor] ?def-value] (if (&type/type= &type/Type ?def-type) (&/T [(&/T [?def-type ?def-cursor]) - (&a/$tuple (&/|list))]) + (&o/$tuple (&/|list))]) (&&type/type->analysis ?def-type)))]] (compile nil ?def-type))) diff --git a/src/lux/compiler/type.clj b/src/lux/compiler/type.clj index c7dbdb557..f80e32a57 100644 --- a/src/lux/compiler/type.clj +++ b/src/lux/compiler/type.clj @@ -8,7 +8,8 @@ clojure.core.match clojure.core.match.array (lux [base :as & :refer [|do return* return fail fail* |let |case]] - [type :as &type]) + [type :as &type] + [optimizer :as &o]) [lux.analyser.base :as &a])) ;; [Utils] @@ -16,12 +17,12 @@ "(-> clojure.lang.Var Analysis Analysis)" (let [tag-meta (meta tag)] (&a/|meta &/$VoidT &/empty-cursor - (&a/$variant (::&/idx tag-meta) (::&/is-last? tag-meta) body)))) + (&o/$variant (::&/idx tag-meta) (::&/is-last? tag-meta) body)))) (defn ^:private tuple$ [members] "(-> (List Analysis) Analysis)" (&a/|meta &/$VoidT &/empty-cursor - (&a/$tuple members))) + (&o/$tuple members))) (do-template [ ] (defn [value] @@ -29,13 +30,13 @@ (&a/|meta &/$VoidT &/empty-cursor ( value))) - ^:private bool$ &a/$bool "(-> Bool Analysis)" - ^:private nat$ &a/$nat "(-> Nat Analysis)" - ^:private int$ &a/$int "(-> Int Analysis)" - ^:private frac$ &a/$frac "(-> Nat Analysis)" - ^:private real$ &a/$real "(-> Real Analysis)" - ^:private char$ &a/$char "(-> Char Analysis)" - ^:private text$ &a/$text "(-> Text Analysis)" + ^:private bool$ &o/$bool "(-> Bool Analysis)" + ^:private nat$ &o/$nat "(-> Nat Analysis)" + ^:private int$ &o/$int "(-> Int Analysis)" + ^:private frac$ &o/$frac "(-> Nat Analysis)" + ^:private real$ &o/$real "(-> Real Analysis)" + ^:private char$ &o/$char "(-> Char Analysis)" + ^:private text$ &o/$text "(-> Text Analysis)" ) (defn ^:private ident$ [value] -- cgit v1.2.3