From bc29c83e75e103c7594ba9483f19170e94abcc85 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Wed, 4 Jan 2017 23:06:55 -0400 Subject: - Fixed a bug in the caching sub-system, where trying to pre-load a module that was deleted halted compilation. --- luxc/src/lux/compiler/cache.clj | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'luxc/src') 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)]] -- cgit v1.2.3