aboutsummaryrefslogtreecommitdiff
path: root/luxc/src
diff options
context:
space:
mode:
authorEduardo Julian2017-01-04 23:06:55 -0400
committerEduardo Julian2017-01-04 23:06:55 -0400
commitbc29c83e75e103c7594ba9483f19170e94abcc85 (patch)
tree5720a4550ce85ec5c6ae11c248fada810d789d91 /luxc/src
parent069f66e0746488c9d2e3c26f14a09b5d416e456f (diff)
- Fixed a bug in the caching sub-system, where trying to pre-load a module that was deleted halted compilation.
Diffstat (limited to 'luxc/src')
-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)]]