diff options
Diffstat (limited to 'src/lux/analyser')
-rw-r--r-- | src/lux/analyser/host.clj | 4 | ||||
-rw-r--r-- | src/lux/analyser/lux.clj | 6 | ||||
-rw-r--r-- | src/lux/analyser/module.clj | 22 |
3 files changed, 16 insertions, 16 deletions
diff --git a/src/lux/analyser/host.clj b/src/lux/analyser/host.clj index 24a67be87..8dff15622 100644 --- a/src/lux/analyser/host.clj +++ b/src/lux/analyser/host.clj @@ -38,7 +38,7 @@ nil exceptions)] (&/fail* (str "[Analyser Error] Unhandled exception: " missing-ex)) - (&/return* state nil))) + (&/return* state &/unit-tag))) ))) (defn ^:private with-catches [catches body] @@ -661,7 +661,7 @@ nil abstract-methods)]] (if (nil? missing-method) - (return nil) + (return &/unit-tag) (|let [[am-name am-inputs] missing-method] (fail (str "[Analyser Error] Missing method: " am-name " " "(" (->> am-inputs (&/|interpose " ") (&/fold str "")) ")")))))) diff --git a/src/lux/analyser/lux.clj b/src/lux/analyser/lux.clj index 7adc32b22..fba8ea15b 100644 --- a/src/lux/analyser/lux.clj +++ b/src/lux/analyser/lux.clj @@ -261,7 +261,7 @@ (|do [[[r-module r-name] [endo-type ?meta ?value]] (&&module/find-def module name) _ (if (and (clojure.lang.Util/identical &type/Type endo-type) (clojure.lang.Util/identical &type/Type exo-type)) - (return nil) + (return &/unit-tag) (&type/check exo-type endo-type)) _cursor &/cursor] (return (&/|list (&&/|meta endo-type _cursor @@ -518,7 +518,7 @@ (|do [module-name &/get-module-name _ (if (= module-name path) (fail (str "[Analyser Error] Module can't import itself: " path)) - (return nil))] + (return &/unit-tag))] (&/save-module (|do [already-compiled? (&&module/exists? path) active? (&/active-module? path) @@ -526,7 +526,7 @@ _ (&&module/add-import path) _ (if (not already-compiled?) (compile-module path) - (return nil))] + (return &/unit-tag))] (return &/Nil$))))) (defn analyse-alias [analyse compile-token ex-alias ex-module] diff --git a/src/lux/analyser/module.clj b/src/lux/analyser/module.clj index 16c020670..4b6013d8e 100644 --- a/src/lux/analyser/module.clj +++ b/src/lux/analyser/module.clj @@ -47,7 +47,7 @@ (fn [m] (&/update$ $imports (partial &/Cons$ module) m)) ms)) state) - nil)))) + &/unit-tag)))) (defn set-imports [imports] "(-> (List Text) (Lux (,)))" @@ -59,7 +59,7 @@ (fn [m] (&/set$ $imports imports m)) ms)) state) - nil)))) + &/unit-tag)))) (defn define [module name def-type def-meta def-value] (fn [state] @@ -76,7 +76,7 @@ #(&/|put name (&/T [def-type def-meta def-value]) %) m)) ms)))) - nil) + &/unit-tag) _ (fail* (str "[Analyser Error] Can't create a new global definition outside of a global environment: " module ";" name))))) @@ -132,7 +132,7 @@ (&/|put alias reference aliases)) %) ms)))) - nil)))) + &/unit-tag)))) (defn find-def [module name] (|do [current-module &/get-module-name] @@ -180,7 +180,7 @@ (defn create-module [name] "(-> Text (Lux (,)))" (fn [state] - (return* (&/update$ &/$modules #(&/|put name +init+ %) state) nil))) + (return* (&/update$ &/$modules #(&/|put name +init+ %) state) &/unit-tag))) (defn enter-module [name] "(-> Text (Lux (,)))" @@ -188,7 +188,7 @@ (return* (->> state (&/update$ &/$modules #(&/|put name +init+ %)) (&/set$ &/$envs (&/|list (&/env name)))) - nil))) + &/unit-tag))) (do-template [<name> <tag> <type>] (defn <name> [module] @@ -208,15 +208,15 @@ _ (&/map% (fn [tag] (if (&/|get tag tags-table) (fail (str "[Analyser Error] Can't re-declare tag: " (&/ident->text (&/T [module tag])))) - (return nil))) + (return &/unit-tag))) tags)] - (return nil))) + (return &/unit-tag))) (defn ensure-undeclared-type [module name] (|do [types-table (types-by-module module) _ (&/assert! (nil? (&/|get name types-table)) (str "[Analyser Error] Can't re-declare type: " (&/ident->text (&/T [module name]))))] - (return nil))) + (return &/unit-tag))) (defn declare-tags [module tag-names type] "(-> Text (List Text) Type (Lux (,)))" @@ -241,7 +241,7 @@ (&/update$ $types (partial &/|put _name (&/T [tags type])))) =modules)) state) - nil)) + &/unit-tag)) (fail* (str "[Lux Error] Unknown module: " module)))))) (do-template [<name> <part> <doc>] @@ -283,7 +283,7 @@ (fail (str "[Analyser Error] Can't tag as lux;" <desc> "? if it's not a " <desc> ": " (str module ";" name))))) _ - (return nil))) + (return &/unit-tag))) test-type &type/Type &meta/type?-tag "type" test-macro &type/Macro &meta/macro?-tag "macro" |