aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--luxc/src/lux/compiler/cache.clj12
1 files changed, 9 insertions, 3 deletions
diff --git a/luxc/src/lux/compiler/cache.clj b/luxc/src/lux/compiler/cache.clj
index 8c30f8c68..5dbaf7ca2 100644
--- a/luxc/src/lux/compiler/cache.clj
+++ b/luxc/src/lux/compiler/cache.clj
@@ -247,9 +247,15 @@
(defn pre-load-cache! [source-dirs]
(|do [:let [fs-cached-modules (enumerate-cached-modules!)]
pre-loaded-modules (&/fold% (fn [cache-table module-name]
- (|do [file-content (&&io/read-file source-dirs (str module-name ".lux"))
- :let [module-hash (hash file-content)]]
- (pre-load! source-dirs cache-table module-name module-hash)))
+ (fn [_compiler]
+ (|case ((&&io/read-file source-dirs (str module-name ".lux"))
+ _compiler)
+ (&/$Left error)
+ (return* _compiler cache-table)
+
+ (&/$Right _compiler* file-content)
+ ((pre-load! source-dirs cache-table module-name (hash file-content))
+ _compiler*))))
{}
fs-cached-modules)
:let [_ (reset! !pre-loaded-cache pre-loaded-modules)]]