aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/lux/tool
diff options
context:
space:
mode:
authorEduardo Julian2020-08-17 21:34:07 -0400
committerEduardo Julian2020-08-17 21:34:07 -0400
commitc9e452617dc14dfe9955dc556640bc07f319224a (patch)
treeaf413cad2aa2ea793b72dab971ed91ff8079b068 /stdlib/source/lux/tool
parentbea5913a915a0bfd795f9e12b40f1d32716a6cf8 (diff)
Add local repo installation to Aedifex.
Diffstat (limited to 'stdlib/source/lux/tool')
-rw-r--r--stdlib/source/lux/tool/compiler/meta/io/context.lux32
1 files changed, 14 insertions, 18 deletions
diff --git a/stdlib/source/lux/tool/compiler/meta/io/context.lux b/stdlib/source/lux/tool/compiler/meta/io/context.lux
index 1dceaaba6..7d6a56b63 100644
--- a/stdlib/source/lux/tool/compiler/meta/io/context.lux
+++ b/stdlib/source/lux/tool/compiler/meta/io/context.lux
@@ -155,26 +155,23 @@
(#.Some [_ path])
(#try.Success path))))
-(def: (enumerate-context system partial-host-extension context enumeration)
- (-> (file.System Promise) Extension Context Enumeration
- (Promise (Try Enumeration)))
+(def: (enumerate-context system context enumeration)
+ (-> (file.System Promise) Context Enumeration (Promise (Try Enumeration)))
(do {@ (try.with promise.monad)}
[directory (!.use (:: system directory) [context])]
(loop [directory directory
enumeration enumeration]
(do @
[files (!.use (:: directory files) [])
- enumeration (monad.fold @ (let [full-host-extension (..full-host-extension partial-host-extension)]
- (function (_ file enumeration)
- (let [path (!.use (:: file path) [])]
- (if (or (text.ends-with? full-host-extension path)
- (text.ends-with? ..lux-extension path))
- (do @
- [path (promise@wrap (..clean-path system context path))
- source-code (!.use (:: file content) [])]
- (promise@wrap
- (dictionary.try-put path source-code enumeration)))
- (wrap enumeration)))))
+ enumeration (monad.fold @ (function (_ file enumeration)
+ (let [path (!.use (:: file path) [])]
+ (if (text.ends-with? ..lux-extension path)
+ (do @
+ [path (promise@wrap (..clean-path system context path))
+ source-code (!.use (:: file content) [])]
+ (promise@wrap
+ (dictionary.try-put path source-code enumeration)))
+ (wrap enumeration))))
enumeration
files)
directories (!.use (:: directory directories) [])]
@@ -183,12 +180,11 @@
(def: Action
(type (All [a] (Promise (Try a)))))
-(def: #export (enumerate system partial-host-extension contexts)
- (-> (file.System Promise) Extension (List Context)
- (Action Enumeration))
+(def: #export (enumerate system contexts)
+ (-> (file.System Promise) (List Context) (Action Enumeration))
(monad.fold (: (Monad Action)
(try.with promise.monad))
- (enumerate-context system partial-host-extension)
+ (enumerate-context system)
(: Enumeration
(dictionary.new text.hash))
contexts))