aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/program/aedifex.lux
diff options
context:
space:
mode:
authorEduardo Julian2020-10-25 05:10:08 -0400
committerEduardo Julian2020-10-25 05:10:08 -0400
commit72b4eecdc514387ab3b1c105cfd49436c9eb1e8d (patch)
tree20d8e52d5769b00be003dea58754b5bea79bb9e3 /stdlib/source/program/aedifex.lux
parente153b011bb94ba95474505c307873616bb493b6d (diff)
Some improvements to the Lux syntax parser.
Diffstat (limited to '')
-rw-r--r--stdlib/source/program/aedifex.lux35
1 files changed, 3 insertions, 32 deletions
diff --git a/stdlib/source/program/aedifex.lux b/stdlib/source/program/aedifex.lux
index 327eb8902..76db24a47 100644
--- a/stdlib/source/program/aedifex.lux
+++ b/stdlib/source/program/aedifex.lux
@@ -33,6 +33,7 @@
[action (#+ Action)]
["#" profile]
["#." project (#+ Project)]
+ ["#." input]
["#." parser]
["#." pom]
["#." cli]
@@ -46,26 +47,6 @@
["#/." auto]
["#/." deploy]]])
-(def: (read-file! path)
- (-> Path (IO (Try Binary)))
- (do (try.with io.monad)
- [project-file (!.use (:: file.system file) [path])]
- (!.use (:: project-file content) [])))
-
-(def: (read-code source-code)
- (-> Text (Try Code))
- (let [parse (syntax.parse ""
- syntax.no-aliases
- (text.size source-code))
- start (: Source
- [["" 0 0] 0 source-code])]
- (case (parse start)
- (#.Left [end error])
- (#try.Failure error)
-
- (#.Right [end lux-code])
- (#try.Success lux-code))))
-
(def: (install! profile)
(-> /.Profile (Promise Any))
(do promise.monad
@@ -99,20 +80,10 @@
(log! (format "Could not resolve dependencies:" text.new-line
error))))))
-(def: project
- (-> Binary (Try Project))
- (|>> (do> try.monad
- [encoding.from-utf8]
- [..read-code]
- [(list) (<c>.run /parser.project)])))
-
(program: [{[profile operation] /cli.command}]
(do {@ io.monad}
- [data (..read-file! /.file)]
- (case (do try.monad
- [data data
- project (..project data)]
- (/project.profile profile project))
+ [?profile (/input.read io.monad file.system profile)]
+ (case ?profile
(#try.Success profile)
(case operation
#/cli.POM