diff options
author | Eduardo Julian | 2021-09-08 02:03:18 -0400 |
---|---|---|
committer | Eduardo Julian | 2021-09-08 02:03:18 -0400 |
commit | 609cc6c16e75c13d87183c38245136fa038b0496 (patch) | |
tree | f5f3b499df0c3e7e6e3dc0c451c9766f34ec07de /lux-bootstrapper/src | |
parent | 964ec62d4fbcc1fb2336a3de355ce3554ef7eb04 (diff) |
No more module annotations.
Diffstat (limited to 'lux-bootstrapper/src')
-rw-r--r-- | lux-bootstrapper/src/lux/analyser.clj | 4 | ||||
-rw-r--r-- | lux-bootstrapper/src/lux/analyser/lux.clj | 4 | ||||
-rw-r--r-- | lux-bootstrapper/src/lux/analyser/module.clj | 22 | ||||
-rw-r--r-- | lux-bootstrapper/src/lux/compiler/cache.clj | 23 | ||||
-rw-r--r-- | lux-bootstrapper/src/lux/compiler/core.clj | 7 |
5 files changed, 9 insertions, 51 deletions
diff --git a/lux-bootstrapper/src/lux/analyser.clj b/lux-bootstrapper/src/lux/analyser.clj index 27323be2b..297ad5482 100644 --- a/lux-bootstrapper/src/lux/analyser.clj +++ b/lux-bootstrapper/src/lux/analyser.clj @@ -160,9 +160,9 @@ (&&lux/analyse-program analyse optimize compile-program ?program))) "lux def module" - (|let [(&/$Item ?meta (&/$Item ?imports (&/$End))) parameters] + (|let [(&/$Item ?imports (&/$End)) parameters] (&/with-location location - (&&lux/analyse-module analyse optimize eval! compile-module ?meta ?imports))) + (&&lux/analyse-module analyse optimize eval! compile-module ?imports))) "lux in-module" (|let [(&/$Item [_ (&/$Text ?module)] (&/$Item ?expr (&/$End))) parameters] diff --git a/lux-bootstrapper/src/lux/analyser/lux.clj b/lux-bootstrapper/src/lux/analyser/lux.clj index f4d76912f..77d54fab2 100644 --- a/lux-bootstrapper/src/lux/analyser/lux.clj +++ b/lux-bootstrapper/src/lux/analyser/lux.clj @@ -666,11 +666,9 @@ (return (doto (promise) (deliver (&/$Right _compiler)))))))) -(defn analyse-module [analyse optimize eval! compile-module ?annotations ?imports] +(defn analyse-module [analyse optimize eval! compile-module ?imports] (|do [_ &/ensure-directive - ==anns (eval analyse optimize eval! &type/Code ?annotations) module-name &/get-module-name - _ (&&module/set-anns ==anns module-name) _imports (&&module/fetch-imports ?imports) current-module &/get-module-name =asyncs (&/map% (fn [_import] diff --git a/lux-bootstrapper/src/lux/analyser/module.clj b/lux-bootstrapper/src/lux/analyser/module.clj index 8c6f06d88..1904e55b7 100644 --- a/lux-bootstrapper/src/lux/analyser/module.clj +++ b/lux-bootstrapper/src/lux/analyser/module.clj @@ -22,7 +22,6 @@ "module-aliases" "defs" "imports" - "module-annotations" "module-state"]) (defn ^:private new-module [hash] @@ -34,8 +33,6 @@ (&/|table) ;; "lux;imports" &/$End - ;; module-annotations - &/$None ;; "module-state" $Active] )) @@ -212,25 +209,6 @@ (&/get$ $imports) (&/|any? (partial = imported-module-name)))) -(defn get-anns [module-name] - (fn [state] - (if-let [module (->> state - (&/get$ &/$modules) - (&/|get module-name))] - (return* state (&/get$ $module-annotations module)) - ((&/fail-with-loc (str "[Analyser Error] Module does not exist: " module-name)) - state)))) - -(defn set-anns [anns module-name] - (fn [state] - (return* (->> state - (&/update$ &/$modules - (fn [ms] - (&/|update module-name - #(&/set$ $module-annotations (&/$Some anns) %) - ms)))) - nil))) - (def empty_annotations (let [dummy_location (&/T ["" 0 0])] (&/T [dummy_location diff --git a/lux-bootstrapper/src/lux/compiler/cache.clj b/lux-bootstrapper/src/lux/compiler/cache.clj index d2b232f74..6d1e5602d 100644 --- a/lux-bootstrapper/src/lux/compiler/cache.clj +++ b/lux-bootstrapper/src/lux/compiler/cache.clj @@ -112,22 +112,16 @@ (|do [_ (delete module)] (return false))) -(defn ^:private install-module [load-def-value module module-hash imports ?module-anns def-entries] +(defn ^:private install-module [load-def-value module module-hash imports def-entries] (|do [_ (&a-module/create-module module module-hash) _ (&a-module/flag-cached-module module) - _ (|case ?module-anns - (&/$Some module-anns) - (&a-module/set-anns module-anns module) - - (&/$None _) - (return nil)) _ (&a-module/set-imports imports) _ (&/map% (partial process-def-entry load-def-value module) def-entries)] (return nil))) (defn ^:private process-module [pre-load! source-dirs cache-table module-name module-hash - _imports-section _module-anns-section _defs-section + _imports-section _defs-section load-def-value install-all-defs-in-module uninstall-all-defs-in-module] (|do [^String descriptor (&&core/read-module-descriptor! module-name) :let [imports (let [imports (vec (.split ^String _imports-section &&core/entry-separator)) @@ -144,17 +138,12 @@ imports)] (if (&/|every? (fn [_module] (contains? cache-table* _module)) imports) - (let [[?module-anns _] (if (= "..." _module-anns-section) - [&/$None nil] - (let [[module-anns _] (&&&ann/deserialize _module-anns-section)] - [(&/$Some module-anns) _])) - def-entries (let [def-entries (vec (.split ^String _defs-section &&core/entry-separator))] + (let [def-entries (let [def-entries (vec (.split ^String _defs-section &&core/entry-separator))] (if (= [""] def-entries) &/$End (&/->list def-entries)))] (|do [_ (install-all-defs-in-module module-name) - _ (install-module load-def-value module-name module-hash - imports ?module-anns def-entries) + _ (install-module load-def-value module-name module-hash imports def-entries) =module (&/find-module module-name)] (return (&/T [true (assoc cache-table* module-name =module)])))) (return (&/T [false cache-table*]))))) @@ -191,14 +180,14 @@ :else (|do [^String descriptor (&&core/read-module-descriptor! module-name) - :let [[_compiler _hash _imports-section _module-anns-section _defs-section] (.split descriptor &&core/section-separator) + :let [[_compiler _hash _imports-section _defs-section] (.split descriptor &&core/section-separator) drop-cache! (|do [_ (uninstall-cache module-name) _ (uninstall-all-defs-in-module module-name)] (return cache-table))]] (if (and (= module-hash (Long/parseUnsignedLong ^String _hash)) (= &/version _compiler)) (|do [[success? cache-table*] (process-module pre-load! source-dirs cache-table module-name module-hash - _imports-section _module-anns-section _defs-section + _imports-section _defs-section load-def-value install-all-defs-in-module uninstall-all-defs-in-module) _ (if success? (return nil) diff --git a/lux-bootstrapper/src/lux/compiler/core.clj b/lux-bootstrapper/src/lux/compiler/core.clj index b2d366d5d..3dbd93140 100644 --- a/lux-bootstrapper/src/lux/compiler/core.clj +++ b/lux-bootstrapper/src/lux/compiler/core.clj @@ -44,7 +44,6 @@ (defn generate-module-descriptor [file-hash] (|do [module-name &/get-module-name - ?module-anns (&a-module/get-anns module-name) defs &a-module/defs imports &a-module/imports :let [def-entries (&/fold (fn [def-entries _def] @@ -117,12 +116,6 @@ module-descriptor (->> (&/|list &/version (Long/toUnsignedString file-hash) import-entries - (|case ?module-anns - (&/$Some module-anns) - (&&&ann/serialize module-anns) - - (&/$None _) - "...") def-entries) (&/|interpose section-separator) (&/fold str ""))]] |